Math 300: HTML (HyperText Markup Language) (back to Math 300 notes)
Hypertext Markup Language, better known as HTML, is
the dominant format for the transfer of information
across the Internet. It was the coupling of the idea
for a browser with HTML that engendered the use of
the term World Wide Web
Each HTML file is a flat text file containing
tags that indicate formatting or other kinds of
objects (e.g. images) to insert. HTML files follow just a few
rules. Some rules are optional - they really have to do with
XHTML, a replacement for HTML which we will learn later.
- Every HTML command is enclosed in < and > characters: e.g.
- Basic HTML atoms are called "tags". Every opening tag
must have a closing tag.
Closing tags are the same as opening tags, except that the name
of the tag is preceded by a slash: e.g. <p> has closing tag
- The opening and closing tags enclose text whose format or content they specify.
- If a tag does not enclose text, it can end itself: put a slash before
the > character: e.g. <br/>
- Tags must be nested properly: e.g.
<b><i>bold italic text<i><b> is correct;
<b><i>bold italic text<b><i> is not.
- The behavior of HTML commands can be modified by inserting
style specifications in the opening tag: e.g.
A Centered Paragraph
- HTML tags should be in lower case
Historically, HTML tags did not need to be closed, did not
need to be nested properly, and it was even considered good style
to write them in upper case letters. It is only with more recent
updates to the language that these rules have become important.
There are many tutorials
available for HTML on the web - we list a few below.
- There is a tutorial at
W3schools. You can find many more just by doing a web search
for "HTML Tutorial".
- There is no more authoritative source concerning
HTML than the
World Wide Web Consortium
In this class we will emphasize the newest standard in the making. HTML5
is nearing the status of an international standard, and most browsers support
it to some extent. It provides a great deal of power that was not available in
HTML4, and which required more machinery to use in XHTML. In short, it makes
things that used to be difficult seem easier.
Some points of style seem to be worth making.
- Always strive to keep your pages independent of the platform/browser used
to view them. There are too many pages on the Web that look good in e.g. Internet
Explorer, but do not work with other browsers.
- Strive to comply with standards. There are too many pages on the Web that
use old or syntactically incorrect HTML.
- Strive to avoid tables. You will fail, since tables are the only elements
in HTML that give full control of alignment. However, there are too many pages
on the Web that use tables much more than is necessary, and this can lead
to formatting problems when content changes.
- Strive to keep procedural and structural markup separated. Use Cascading
Style Sheets as much as you can.
There is a terrific site giving details of HTML and CSS at