Developer

Basic HTML tag guide

Are you unfamiliar with basic HMTL tags? This guide provides a list of tags and their brief explanations.

By Fred Dekker and Donald St. John

The following are brief explanations of basic HTML tags:

<HTML></HTML> - tells browsers the page is written in HTML; entire document goes between HTML tags

<HEAD></HEAD> - appears just below the HTML tag in every HTML document; contains information about the document but does not appear on the Web page

<TITLE></TITLE> - specifies the title of the document; the text between these tags appears in the browser's title bar but not on the Web page itself

<BODY></BODY> - contains all the text and images that will appear on the Web page, together with all the HTML elements that provide the control/formatting of the page

    BODY attributes:
    BGCOLOR - designates the background color, using a name or a hex value
    BACKGROUND - designates an image as a page's background (wallpaper)
    TEXT - designates the text color, using a name or a hex value
    LINK - designates the color of links, using a name or a hex value
    VLINK - designates the color of followed links, using a name or a hex value
    ALINK - designates the color of links on click, using a name or a hex value

<H1><H6></H1>-</H6> - codes text as headings; <H1> is the largest, <H6> the smallest

<CENTER></CENTER> - centers text and other elements on a page

<BR> - breaks text onto a new line (no vertical space between lines)

<P></P> - breaks text into a new paragraph (leaves a blank line above the new paragraph)

<I></I> - creates italicized text

<B></B> - creates bold text

<PRE></PRE> - designates preformatted text

<TT></TT> - designates teletype or monospaced text

<HR> - inserts a horizontal rule; helpful in breaking up sections of a page
<HR SIZE=x> - designates the size (height) of a rule
<HR WIDTH=x> - designates the width of a rule, in percentage or absolute value
<HR NOSHADE> - inserts a rule without a shadow

<A></A> - marks text as the start and/or destination of a link; requires the HREF or NAME attribute

HREF - attribute of the <A> tag; makes text or image between <A> tags a hyperlink

NAME - attribute of the <A> tag; makes text or image between <A> tags the target of a hyperlink

<IMG SRC="x"> - Adds an image

<UL></UL> - creates an unordered (bulleted) list

<OL></OL> - creates an ordered (numbered) list

<LI> - used in conjunction with the <UL> or <OL> tag, designates a list item in an unordered or ordered list

<DL></DL> - creates a definition list

<DT> - used in conjunction with the <DL> tag, designates a definition title in a definition list

<DD> - used in conjunction with the <DL> tag, designates a definition description in a definition list

If you're curious about the myriad HTML tags we didn't cover, check out the HTML Compendium's comprehensive list of HTML elements.

The steps to getting your pages on the Web vary by Internet service provider. You'll have to contact your ISP to find out exactly what you have to do. And if your ISP doesn't give you server space on which to post Web pages, CNET can help you find another one.

Fred Dekker is one of the Founders of The H.E.L.P. Community, an online resource for beginning Webmasters.

Donald St. John was the founding Webmaster at PC Games magazine.

Editor's Picks

Free Newsletters, In your Inbox