See also: HTML attributes

Note to readers: This document attempts to define all HTML tags - not just those available for use on E2.
Please do not confuse this document with E2 HTML tags, E2 HTML, E2 HTML tags : Quick Start, or E2 FAQ: HTML.

HTML tags, also known as HTML elements are used to define the structure of an HTML document. While the web was still in its infancy, dozens of tags were created for convenience and stylistic purposes. This had the effect of causing compatibility problems with browsers which are still seen today. It is now the official standard to separate style from structure through the use of Cascading Style Sheets.

Parts of an HTML Document

  • Document Type Definition (DTD) - The first line in an HTML document should contain a !DOCTYPE declaration which points to an external DTD that defines the structure and format of the document so that the browser can properly parse and display it
  • html tag - With the exception of the document type definition, everything within the HTML document should be contained within an opening and closing html tag.
    • head tag - the head tag can contain several other head elements that define information about the document, but is not part of the viewable content of the document
      • Head Elements - these elements can specify base information, related or linked documents, indexes, meta information, scripting, styles, and the document title
           Examples: script, style, meta, link, object
    • Viewable content - with the exception of comments, all elements below the closing head tag are viewable to the user. There are two types of viewable content: body and frameset.
      • body - The standard HTML document contains its viewable content between body tags which can contain numerous other elements including:
        • block-level elements - specifies information about a block of text or objects that are grouped separately from surrounding elements, and can usually be nested. While not always the case, most block level elements require both an opening and closing tag. Block-level elements can be categorized as:
          • heading elements - allows the data to be organized into an outline type hierarchy
               Examples: h1, h2, h3, h4, h5, h6
          • list elements - allows the data to be organized into lists
               Examples: ol, ul, dl
          • preformatted elements - displays the text exactly as it is formatted in the document (i.e., it doesn't ignore whitespace)
               Examples: pre (this has its own group because it formerly had plaintext, listing, xmp)
          • other block elements - block elements that cannot be grouped together because of their specific nature
               Examples: div, noscript, blockquote, form, table, fieldset, address
        • inline elements or text-level elements - specifies the way (usually small) parts of the document should be rendered, treated, or displayed. Inline elements can be categorized as:
          • font styles - specify the size and style of the text
               Examples: tt, i, b, big, small
          • phrases - gives special meaning to phrases, or short areas of text. These are different from font styles because there is no standard on how these should be rendered in the browser - they are more for organization and clarity than for presentation.
               Examples: em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym
          • special elements - these elements perform special functions, or must be handled a certain way by the browser
               Examples: a, img, object, br, script, map, q, sub, sup, span, bdo
          • form controls - not to be confused with the form block element, these inline sections of the form are actually where the user inputs or selects the information
               Examples: input, select, textarea, label, button
      • frameset - A document that uses frames subdivides the browser window into smaller viewable areas called frames. Each of these areas is a separate document, which if it is another HTML document, can contain a body or another frameset type document.

Method of Use

An HTML tag is specified by surrounding the tag name with angle brackets (< and >). If required, that tag can then be closed by placing a forward slash (/) in front of the tag name and again surrounding it by angle brackets. In the XHTML standard, a tag can be opened and closed in one step by putting a forward slash at the end of the tag name, but between the angle brackets.

  • Unclosed tag:    <tagname>
  • Open tag with closing tag:    <tagname> ... </tagname>
  • Opened/closed tag (XHTML only):    <tagname />

Standard HTML Tags

The following, are now, or once were tags in the HTML/XHTML standard as defined by the World Wide Web Consortium (W3C or W3). I have provided an example of all tags that E2 supports in writeups.

a
anchor

HTML: <a href="/index.pl?node=HTML%20tags">HTML tags</a>
Result: HTML tags

abbr
abbreviated form (functionality usually implemented through tooltips)

HTML: <abbr title="Everything2">E2</abbr>
Result: E2

acronym
specifies an acronym (functionality usually implemented through tooltips)

HTML: <acronym title="Self-Contained Underwater Breathing Apparatus">SCUBA</acronym>
Result: SCUBA

address
contact information on the author of the document
applet
Java applet (superseded by <object>)
area
client-side image map area
b
bold text style

HTML: <b>bold text</b>
Result: bold text

base
document base URI
basefont
base font size (superseded by Cascading Style Sheets)
bdo
I18N bi-directional over-ride
big
large text style

HTML: <big><big>double big</big></big>
Result: double big

blockquote
long quotation
 
HTML:
<blockquote>In the beginning God created the heaven and the earth. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. And God said, Let there be light: and there was light. And God saw the light, that it was good: and God divided the light from the darkness. And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.</blockquote>
Result:
In the beginning God created the heaven and the earth. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. And God said, Let there be light: and there was light. And God saw the light, that it was good: and God divided the light from the darkness. And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
body
document body
br
forced line break

HTML: line 1<br>line 2
Result: line 1
line 2

button
push button
caption
table caption
center
shorthand for <div align="center">
cite
citation

HTML: More information about HTML tags can be found at the <cite>World Wide Web Consortium</cite>
Result: More information about HTML tags can be found at the World Wide Web Consortium

code
computer code fragment

HTML: <code>bool isLeapYear = (!(year%4) && (year%100)) || !(year%400);</code>
Result: bool isLeapYear = (!(year%4) && (year%100)) || !(year%400);

col
table column
colgroup
table column group
dd
definition description (see "dl" for example)
del
deleted text

HTML: This writeup <del>sucks</del> deserves a C!
Result: This writeup sucks deserves a C!

dfn
instance definition
dir
directory list (superseded by <ol> and <ul>)
div
generic language/style block container
dl
definition list
 
HTML:
<dl>
 <dt>demonym</dt>
  <dd>place-based label that describes a resident of a particular city, territory, country, or region.</dd>
 <dt>kibibyte</dt>
  <dd>1024 bytes</dd>
</dl>

Result:
demonym
place-based label that describes a resident of a particular city, territory, country, or region.
kibibyte
1024 bytes
dt
definition term (see "dl" for example)
em
emphasis

HTML: <em>emphasized text</em>
Result: emphasized text

fieldset
form control group
font
local change to font (superseded by Cascading Style Sheets)
form
interactive form
frame
subwindow
frameset
window subdivision
h1, h2, h3, h4, h5, h6
headings
 
HTML:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Result:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
head
document head/header
hr
horizontal rule (i.e., horizontal line)
 
HTML:
<hr>
Result:
html
document root element
i
italic text style

HTML: <i>italicized text</i>
Result: italicized text

iframe
inline subwindow
img
embedded image
input
form control to allow user to enter text or make a selection
ins
inserted text

HTML: I don't give a <ins>flying</ins> fsck
Result: I don't give a flying fsck

isindex
single line prompt (superseded by <input type="text">)
kbd
text to be entered by the user (i.e., keyboard)

HTML: Press <kbd>F1</kbd> for help
Result: Press F1 for help

label
form field label text
legend
fieldset legend
li
list item (see <ol> or <ul> for an example)
link
a media-independent link
listing
enclose text to be presented literally in a monospaced text style (superseded by <pre>)
map
client-side image map
menu
menu list (superseded by <ol> and <ul>)
meta
generic metainformation/metadata
nextid
defines a unique id for the document (used by software such as HTML editors only)
noframes
alternate content container for non frame-based rendering
noscript
alternate content container for non script-based rendering
object
generic embedded object
ol
ordered list
 
HTML:
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>

Result:
  1. One
  2. Two
  3. Three
optgroup
option group
option
selectable choice
p
paragraph

HTML:
<p>This is paragraph one. This is paragraph one. This is paragraph one. This is paragraph one. This is paragraph one.</p>
<p>This is paragraph two. This is paragraph two. This is paragraph two. This is paragraph two. This is paragraph two.</p>

Result:

This is paragraph one. This is paragraph one. This is paragraph one. This is paragraph one. This is paragraph one.

This is paragraph two. This is paragraph two. This is paragraph two. This is paragraph two. This is paragraph two.

param
named property value
plaintext
used to stop the parsing of HTML elements
pre
preformatted text (WYSIWYG)
 
HTML:
<pre>
   |   |
 T | I | C
---+---+---
 T | A | C
---+---+---
 T | O | E
   |   |
</pre>

Result:
   |   |
 T | I | C
---+---+---
 T | A | C
---+---+---
 T | O | E
   |   |
q
short inline quotation (NOTE: this does not work properly in most browsers, so I have an example of how it should be displayed according to W3C.)

HTML: in10se says, <q lang="en-us">I was taking in the catbox and heard EDB say <q lang="en-us">GRRrrr</q> so I left.</q>
Result: in10se says, I was taking in the catbox and heard EDB say GRRrrr so I left.
W3C Standard: in10se says, "I was taking in the catbox and heard EDB say 'GRRrrr' so I left."

rb
ruby base
rbc
ruby base container
rp
similar to the noframes or no script tag, this provides alternate content for browsers that don't support ruby
rt
ruby text
rtc
ruby text container
ruby
defines a ruby area
s
strike-through text style

HTML: I <s>hate</s> love you!
Results: I hate love you!

samp
sample program output, scripts, etc.

HTML: The program will output either <samp>true</samp> or <samp>false</samp>.
Result: The program will output either true or false.

script
script statements
select
option selector
small
small text style

HTML: <small>small text</small>
Result: small text

span
generic language/style inline container
strike
strike-through text style (superseded by <s>)
strong
strong emphasis

HTML: <strong>This text is not weak!<strong>
Result: This text is not weak!

style
style information (i.e., Cascading Style Sheets)
sub
subscript

HTML: H<sub>2</sub>O is water
Result: H2O is water

sup
superscript

HTML: 2<sup>10</sup> = 1024
Result: 210 = 1024

table
container for placing data into rows and columns
tbody
table body
td
table data cell
textarea
multi-line text field
tfoot
table footer
th
table header cell
thead
table header
title
document title
tr
table row
tt
teletype or monospaced text style

HTML: <tt>teletype text</tt>
Result: teletype text

u
underlined text style

HTML: <u>Underlined</u> text can be easily confused with a hyperlink
Result: Underlined text can be easily confused with a hyperlink

ul
unordered list
 
HTML:
<ul>
<li>blue</li>
<li>green</li>
<li>red</li>
</ul>

Result:
  • blue
  • green
  • red
var
instance of a variable or program argument

HTML: Set a value for <var>inputFile</var> before calling the function.
Result: Set a value for inputFile before calling the function.

xmp
enclose text to be presented literally in a monospaced text style (superseded by <pre>)

Tags that aren't Tags

The following are not really "tags", but are similar enough to be included here.

!--
inline comment
!DOCTYPE
an SGML declaration that specifies information about the document type including the top element, availability, registration, organization, type, label, language, and URI

Proprietary Tags

Here are many of the most well known proprietary HTML tags that several companies have tried to use over the years. Some of them caught on, and are well supported even though they are not part of any standard, and some of them just faded away. While many people complain that Microsoft tries to implement too many things as proprietary, you will note that most of these were created by Netscape. I have not been able to determine how much (if any) the Mozilla project had to do with the non-standard Netscape tags, but I would assume it was on the Netscape side only.

align (Netscape)
a block element used for alignment of text and objects
animate (IBM)
used to animate images by specifying multiple static images
audioscope (WebTV)
used to display the amplitude of stereo sound vs. time
bgsound (Microsoft)
plays a sound in the background
blackface (WebTV)
darker and thicker than normal bold text
blink (Netscape)
causes text to blink
comment (Microsoft)
allows the use of comments, but does nothing more than <!-- --> style comments
embed (Netscape)
allows the loading of non-HTML supported file types (superseded by <object>)
ilayer (Netscape)
an attempt to make the web browser support a third dimension or z-layer
keygen (Netscape)
used to process security transactions with web-based certificate management systems
layer (Netscape)
an attempt to make the web browser support a third dimension or z-layer
marquee (Microsoft)
adds scrolling text to the document
multicol (Netscape)
displays contents in a multi-column format like a newspaper
nobr (?)
specifies to disallow a line break
noembed (Netscape)
alternate content for browsers that don't support the embed tag
nolayer (Netscape)
alternate content for browsers that don't support the layer tag
nosave (Netscape)
causes the contents of the tag not to be saved if the page is saved
sound (Mosaic)
plays a sound in the background
spacer (Netscape)
tag to help control whitespace
wbr (?)
Allows a line break
xml (Microsoft)
include embedded XML-based content (referred to as a Data Island) in an HTML document

HTML Tags Over Time

The following chart shows the supported tags for the following W3 standards:

	 HT20 HT32 H40T H41T X10T H40F H41F X10F H40S H41S X10S XH11 X10B
a           Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
abbr        -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
acronym     -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
address     Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
applet      -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
area        -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
b           Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
base        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
basefont    -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
bdo         -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
big         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
blockquote  Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
body        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
br          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
button      -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
caption     -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
center      -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
cite        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
code        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
col         -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
colgroup    -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
dd          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
del         -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
dfn         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
dir         Y    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
div         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
dl          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
dt          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
em          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
fieldset    -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
font        -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
form        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
frame       -    -    -    -    -    Y    Y    Y    -    -    -    -    -
frameset    -    -    -    -    -    Y    Y    Y    -    -    -    -    -
h1          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
h2          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
h3          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
h4          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
h5          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
h6          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
head        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
hr          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
html        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
i           Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
iframe      -    -    Y    Y    Y    Y    Y    Y    -    -    -    -    -
img         Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
input       Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
ins         -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
isindex     Y    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
kbd         Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
label       -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
legend      -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y     
li          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
link        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
listing     Y    Y    -    -    -    -    -    -    -    -    -    -    -
map         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
menu        Y    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
meta        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
nextid      Y    -    -    -    -    -    -    -    -    -    -    -    -
noframes    -    -    Y    Y    Y    Y    Y    Y    -    -    -    -    -
noscript    -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
object      -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
ol          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
optgroup    -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
option      Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
p           Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
param       -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
plaintext   Y    Y    -    -    -    -    -    -    -    -    -    -    -
pre         Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
q           -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
rb          -    -    -    -    -    -    -    -    -    -    -    Y    -
rbc         -    -    -    -    -    -    -    -    -    -    -    Y    -
rp          -    -    -    -    -    -    -    -    -    -    -    Y    -
rt          -    -    -    -    -    -    -    -    -    -    -    Y    -
rtc         -    -    -    -    -    -    -    -    -    -    -    Y    -
ruby        -    -    -    -    -    -    -    -    -    -    -    Y    -
s           -    -    Y    Y    Y    Y    Y    Y    -    -    -    -    -
samp        Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
script      -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
select      Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
small       -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
span        -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
strike      -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
strong      Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
style       -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
sub         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
sup         -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
table       -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
tbody       -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
td          -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
textarea    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
tfoot       -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
th          -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
thead       -    -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
title       Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
tr          -    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
tt          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    -
u           -    Y    Y    Y    Y    Y    Y    Y    -    -    -    -    -
ul          Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
var         Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y    Y
xmp         Y    Y    -    -    -    -    -    -    -    -    -    -    -

See also: HTML attributes

Log in or registerto write something here or to contact authors.