Elements of an HTML document

HTML instructions are called `elements'. These can be divided into two broad categories -- those that define how the BODY of the document is to be displayed by the browser, and those that define information `about' the document, such as the title or relationships to other documents. Elements are denoted by the tag <element_name> . This is simply the element name surrounded by left and right angle brackets.

For example, the heading at the top of this page is marked by the element H1 (a level 1 heading) which is simply

<H1> Elements of an HTML document </H1>.

Element names are case independent

Example: <em>, <Em> or <EM>.

Empty Elements

Empty elements are elements that do not require an ending tag. An example is the <HR> element, which draws a horizontal line across the page.

Elements can have Arguments

These arguments are called attributes of the element. For example, consider the element A, which marks a region of text as the beginning (or end) of a hypertext link. This element can have several attributes. One of them, HREF, specifies the hypertext document that the marked piece of text is linked to. Example:
<A HREF="http://www.someplace/path/file.html">marked text</a>.

Common HTML elements


<H1>text</H1>A Section heading. HTML allows for six levels of headings, marked by the labels H1 (the boldest), H2,... , H6.
<P> text [</P>]Denotes a paragraph break

nformation Providing text <BR>Indicates that a new line is to start at the given point

<B>Bold</B>Bold type

<I>italic</I>Italic type

<TT>typewriter</TT>typewriter font

<PRE> Preformatted text </PRE>Renders text without reformatting it, like this...
This  is a     Preformatted
         text.


<HR>The horizontal line.
<!-- text -->A comment line.
Here's a great example of many different formatting tags in one document.

It's important to remember that the tags are suggestions to the browsers about what the text is, not exactly how to represent it. Some browser might decide to represent different header tags in different colors, but the same size font. Other browsers (like Lynx) don't even have different font sizes. This is a good thing to keep in mind when preparing documents for wide distribution.


[Next] [Previous] [Index]


HTML 2.0 Checked