Although HTML is a form of Standard Generalized Markup Language (SGML), the HTML Document Type Definition (DTD) lacks much of the structure that is found in more sophisticated DTDs, such as DocBook. Despite HTML's simpliticy (perhaps because of it), HTML has gained a wide following.
Different Web browsers will display the same HTML document in different ways. That's because HTML, like all SGMLs, doesn't specify how the final document should look; HTML just specifies the document structure.
All HTML documents should have a title and a body, using the following tags:
<html>
<title> Document's Title </title>
<body>
Document's Body
</body>
</html>
In the document's body, you can also use these tags to seperate sections:
<h1> A headline </h1>
<h2> A subhead </h2>
<h3> A smaller subhead </h3>
<h4> A still smaller subhead </h4>
<hr> Draws a horizontal rule
<p> Break between paragraphs
<br> Line break without additional space
These tags control the way that the text is displayed:
<b> Bold </b>
<em> Emphasis </em>
<strong> Over-emphasis </strong>
<i> Italics </i>
<blink> Blinking </blink>
<pre> Preformatted Text </pre> (Fixed-width text preserving line breaks.)
<listing> Fixed width text chunk </listing>
<xmp> Program source </xmp> (Will reproduce angle brackets <,>)
<code> Word change </code>
<tt> Word change also </tt>
<center> Centered </center>
<blockquote> A long quotation block </blockquote>
< Less than ( < )
> Greater than ( > )
& Ampersand ( & )
® Registered trademark ( ® )
© or &#169 Copywrite ( © )
ü or &#252 U-umlaut ( ü )
½ One half ( ½ )
<img src="drawing.gif"> Includes the image file drawing.gif
<a href="http://www.cpg.com/info.html"> A hyper-link </a>
<ul> An unnumbered list
<li> cats Each list element
</ul> End of the unnumbered list
<ol> A numbered, or ordered, list
<li> orange
</ol>
<dl> A definition list; for example, a glossary
<dt> CPG The term being defined
<dd> Computer Publishing Group (the definition)
</dl> End of definition list
Many of these tags can take optional arguments:
<hr width="50%"> Draws a horizontal line halfway across
<IMG ALIGN=MIDDLE SRC="line_sun.gif" ALT="Sun Bar">
Specifies that an image should be aligned in the middle of the screen, with the words "Sun Bar" displayed if the viewer cannot display the file line_sun.gif.
Finally, HTML can be used to display push-buttons, forms, pull down menus and radio buttons:
<form action="url"> A form, which calls URL when it is activated
<input type=type name="a name" value="default value" size=40>
Where type can be:
text Text entry, the default
password Text entry, no character echo
checkbox A toggle button
radio A radio button for other toggles with the same name
submit A push button that causes a query to be sent to URL
reset A push button that causes the form to be reset
</form> End of form