HTML Tags

Contents:
HTML Tag and Attribute Descriptions

This section lists the known HTML tags and attributes currently available for use in Web documents. There are many different browsers out there, and they do not all support the same set of tags.

If keeping track of all the browsers and all their differences makes your head spin, no fear. Netscape Navigator and Microsoft's Internet Explorer are the two most popular browsers, and are responsible for almost all of the non-standard extensions to HTML. Browser Comparison, discusses the most important differences between the latest versions of these two browsers.

The most recent version of Netscape Navigator is 3.0. Tags and attributes specific to this browser have N3 at the beginning of their descriptions. Microsoft's Internet Explorer is also currently at version 3.0. It will be indicated by IE3. Browser-specific tags for the earlier versions of the browsers (e.g., IE2 or N2) are assumed to be supported in the later versions.

HTML Tag and Attribute Descriptions

<a>

Create a hyperlink (href attribute) or fragment identifier (name attribute) within a document.

Attributes

Example

To create an anchor named info at some point in a document called doc.html, use the <a> tag with the name attribute:

<a name="info">Information</a> 

To provide a hyperlink to that point in doc.html, use the <a> tag with the href attribute appending the anchor name to the filename using a hash mark (#):

<a href="doc.html#info">Link to information</a> 

<address>

The enclosed text is an address.

<applet>

Define an executable applet within a text flow.

Attributes

<area>

Define a mouse-sensitive area in a client-side image map.

Attributes

<b>

Format the enclosed text using a bold typeface.

<base>

Specify the base URL for all relative URLs in this document.

Attributes

<basefont>

Specify the font size for subsequent text.

Attributes

<bgsound>

IE2 and later. Define background audio for the document.

Attributes

<big>

Format the enclosed text using a bigger typeface.

<blockquote>

The enclosed text is a block quotation.

<body>

Delimit the beginning and end of the document body.

Attributes

<br>

Break the current text flow, resuming at the beginning of the next line.

Attributes

<caption>

Define a caption for a table.

Attributes

See Tables, for more information on using tables.

<center>

Center the enclosed text.

<cite>

The enclosed text is a citation.

<code>

The enclosed text is a code sample.

<col>

IE2 and later. Set properties for a column (or columns) within a <colgroup> of a table.

Attributes

<colgroup>

IE2 and later. Set properties for designated column or columns within a table Also indicates where vertical rules will be drawn when rules=groups is set in the <table> tag.

Attributes

<comment>

IE2 and later. Place a comment in the document. Comments will be visible in all other browsers. Comments can be placed within <!- - comment text - -> for all browsers.

<dd>

Define the definition portion of an element in a definition list.

<dfn>

Format the enclosed text as a definition.

<dir>

Create a directory list containing <li> tags.

Attributes

<div>

Create a division within a document.

Attributes

<dl>

Create a definition list containing <dt> and <dd> tags.

Attributes

<dt>

Define the definition term portion of an element in a definition list.

<em>

Format the enclosed text with additional emphasis.

<embed>

Embed an object into a document. Additional parameters to those listed here may be included depending on the embedded object.

Attributes

<font>

Set the size, color, or typeface of the enclosed text.

Attributes

<form>

Delimit a form.

Attributes

See HTML Form Tags, for more information on using forms.

<frame>

Define a frame within a frameset.

Attributes

See Frames for more information on using frames.

<frameset>

Define a collection of frames or other framesets.

Attributes

See Frames for more information on using frames.

<hn>

The enclosed text is a level n header; for level n from 1 to 6.

Attributes

<head>

Delimit the beginning and end of the document head.

<hr>

Break the current text flow and insert a horizontal rule.

Attributes

<html>

Delimit the beginning and end of the entire HTML document.

Attributes

<i>

Format the enclosed text in an italic typeface.

<iframe>

IE3 only. Define a floating frame within a document with similar placement to <img>. This element requires a closing tag.

Attributes

See Frames for more information on using frames.

<img>

Insert an image into the current text flow.

Attributes

<input type=checkbox>

Create a checkbox input element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=file>

Create a file-selection element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=hidden>

Create a hidden element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=image>

Create an image input element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=password>

Create a content-protected text-input element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=radio>

Create a radio-button input element within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=reset>

Create a reset button within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=submit>

Create a submit button within a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<input type=text>

Create a text input element within a <form>. (This is the default input type.)

Attributes

See HTML Form Tags for more information on using forms.

<isindex>

Create a "searchable" HTML document.

Attributes

<kbd>

The enclosed text is keyboard-like input.

<li>

Delimit a list item in an ordered (<ol>) or unordered (<ul>) list.

Attributes

<link>

Define a link in the document <head> between this document and another document.

Attributes

<listing>

Same as <pre width=132> ... </pre>; deprecated: don't use.

<map>

Define a map containing hotspots in a client-side image map.

Attributes

<marquee>

IE2 and later. Create a scrolling-text marquee.

Attributes

<menu>

Define a menu list containing <li> tags.

Attributes

<meta>

Provides additional information about a document.

Attributes

<multicol>

N3 only. Format enclosed HTML and text in multicolumn format. Text and elements will flow across specified number of columns to give them approximately equal length.

Attributes

<nextid>

Define the labeling start point for automatic document-generation tools.

Attributes

<nobr>

No breaks allowed in the enclosed text.

<noframes>

Define content to be presented by browsers that do not support frames.

See Frames for more information on using frames.

<noscript>

N3 only. Specify alternative content for browsers that do not support JavaScript. See JavaScript Quick Reference, for more information on JavaScript.

<object>

IE3 only. Insert an object into the document. This tag is used to specify applets, OLE controls, and other media objects.

Attributes

<ol>

Define an ordered list containing numbered (ascending) <li> elements.

Attributes

<option>

Define an option within a <select> item in a <form>.

Attributes

See HTML Form Tags for more information on using forms.

<p>

Start and end a paragraph.

Attributes

<param>

Supply a parameter to the <applet> or <object> surrounding this tag.

Attributes

<plaintext>

Render the remainder of the document as preformatted plain text.

<pre>

Render the enclosed text in its original, preformatted style, honoring line breaks and spacing verbatim.

Attributes

<s>

The enclosed text is struck through with a horizontal line.

<samp>

The enclosed text is a sample.

<script>

Specify enclosed script in a supported scripting language to be used in the document.

Attributes

See JavaScript Quick Reference, for more information on JavaScript.

<select>

Define a multiple-choice menu or scrolling list within a <form>, containing one or more <option> tags.

Attributes

See HTML Form Tags for more information on using forms.

<small>

Format the enclosed text using a smaller typeface.

<spacer>

N3 only. Insert a whitespace element in a document.

Attributes

<span>

IE3 only. Specify style-sheet formatting to text between tags.

Attributes

<strike>

The enclosed text is struck through with a horizontal line.

<strong>

Strongly emphasize the enclosed text.

<style>

IE3 only. Surrounds list of style elements to be used in formatting of document. The <style> block comes before the <body> tag and outside all other elements except <html> ... </html>.

<sub>

Format the enclosed text as a subscript.

<sup>

Format the enclosed text as a superscript.

<table>

Define a table.

Attributes

See Tables for more information on tables.

<tbody>

IE2 and later. Specify the rows in a table to be grouped as the main table body. Requires no ending tag. This element is used to indicate where rules will be drawn when rules=groups is used in the <table> tag.

<td>

Define a table data cell.

Attributes

See Tables for more information on tables.

<textarea>

Define a multiline text input area within a <form>; content of the <textarea> tag is the initial, default value.

Attributes

See HTML Form Tags for more information on forms.

<tfoot>

IE2 and later. Specify the rows that will be grouped as the table footer. Requires no ending tag. Used to indicate where rules will be drawn when rules=groups is set in the <table> tag. See Tables for more on tables.

<th>

Define a table header cell.

Attributes

See Tables for more information on tables.

<thead>

IE2 and later. Specifies the rows that will be grouped as the table header. Requires no ending tag. This element is used to indicate where rules will be drawn when rules=groups is set in the <table> tag. See Tables for more information on tables.

<title>

Define the HTML document's title.

<tr>

Define a row of cells within a table.

Attributes

See Tables for more information on tables.

<tt>

Format the enclosed text in typewriter-style (monospaced) font.

<ul>

Define an unordered list of bulleted <li> elements.

Attributes

<var>

The enclosed text is a variable's name.

<wbr>

Indicate a potential word break point within a <nobr> section.

<xmp>

Same as <pre width=80> ... </pre>; deprecated, do not use.