HyperText Markup Language
[Previous]  [Next]

Glossary of Selected HTML Tags (By Category)


Required Structural Tags

View the Skeleton HTML Document to see an example of the required elements of every HTML document. In addition, the Library of Congress Footer is required at the bottom of every HTML page on the Library's Web Site.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN" "http://www.w3.org/tr/html40/loose.dtd"> - Document Prologue
Identifies the version of the HTML specification used in the document. Required as the first code on all LC HTML documents.
<HTML>...</HTML> - HTML Section
Surrounds the entire HTML document. The only code that preceeds <HTML>...</HTML> is the "Document Prologue."
<HEAD>...</HEAD> - Head Section
Contains elements that are not normally displayed by the Web browser, but are used for indexing and URL resolution.
<TITLE>...</TITLE> - Document Title
Indicates the "HTML title" of the document. Most browsers display the text within these codes on the title bar or in a special "title window."
<BASE HREF="URI"> - Base URI for the Current Document
Identifies the current URI (currently by "URL") of the file. You may not be able to assign this until the page is saved onto the server. The base URI is used to resolve "relative" links.
<META> - Meta Information
Used to contain "meta" information. The "description" and "keywords" content types are now required on all LC Web pages.
<BODY BGCOLOR="#FFFFFF">...</BODY> - Body Section
Surrounds text and codes that display or affect the display of the Web page. LC default is a white background.


Comments

<!-- COMMENT --> - Comments
Comments are used to insert instructions or comments within the HTML file. Comments do not display except in the HTML source code.


Text Formatting Tags

<P>...</P> - Paragraph Break
Creates a paragraph break or hard return. Differing from the <BR> code, a <P> includes a blank line of white space. However, only one blank line may be achieved, no matter how many paragraph breaks are used.
<BR> - Line Break
Indicates the start of a new line, instead of automatic line wrap -- the default formatting in an HTML document.
<HR> - Horizontal Rule
Places a horizontal line across the page. The line resizes according to each browser's screen width at any given time.
<Hx>...</Hx> - Headings 1-6
The Web browser supplies the appropriate sized and styled font for each heading level (1-6). Since the "heading" code may imply "style" as well as "size" (determined by each individual browser) do not include strong, emphasis, bold, or italics within a heading code.
<BLOCKQUOTE>...</BLOCKQUOTE> - Quoted or Captioned Text
Marks a block of text as quoted or as a "caption." Most browsers render the text as indented from the left and right margins, and often italicize it.
<PRE>...</PRE> - Preformatted Text
Used to preserve the character and line spacing of the enclosed text. Most browsers display text within the <PRE>...</PRE> codes in a standard, monospace font like courier.
<DIV>...</DIV> - Logical Division
Used to apply style sheet settings to a block of text (and or graphics). It is a "block-level" element.

Lists of various types:

<OL>...</OL> - Ordered List
Use with the <LI> tag to create numbered lists. May be nested.
<UL>...</UL> - Unordered List
Use with the <LI> tag to create bulleted lists. May be nested.
<DL>...</DL> - Definition List
Each term in the list is identified by the <DT> tag, and the definition of each term is contained within the <DD> tag. May be nested.


Character Formatting Tags

Logical Formatting Tags

Indicates a logical condition that can be rendered by any browser in different ways.
<STRONG>...</STRONG> - Strong
Indicates "strong" emphasis. Most browsers display as bolded.
<EM>...</EM> - Emphasis
Indicates emphasis. Most browsers display as italicized.
<CITE>...</CITE> - Citation
Renders the enclosed text in a distinguishing style to indicate a citation. Most browsers display as italicized.

Physical Tags

Indicates a physical appearance for your text. Browsers that can't display bold, italics, or underline will either ignore the codes or render them in some other way.
<B>...</B> - Bold
Enclosed text is displayed in boldface. Prefer a logical tag as appropriate.
<I>...</I> - Italics
Enclosed text is displayed in italics. Prefer a logical tag as appropriate.
<U>...</U> - Underline
Specifies that the enclosed text be underlined. Use of this tag is not highly recommended.

Font Control

<FONT>...</FONT> - Font Appearance
Specifies the size (relative to the normal font) and color of the enclosed text.
<SPAN>...</SPAN> - Inline Style Container Tag

The SPAN tag is used to apply style sheet information to a word or short phrase. It is an "inline" element.


Linking to Other Documents

<A>...</A> - Hypertext Anchor
The hypertext anchor tag allows you to make a word, phrase or image into a selectable link to another location in the current document, an external document or an external image. When considering your link text, anchor as many words as needed to allow the link text to stand by itself. Remember, there are a variety of user interfaces that will be used to access your page, including text readers for the blind which can be set to read only link text. For example, use "Library of Congress Home Page" instead of "Home Page"; "Prints and Photographs Illustrated Guide" instead of "Illustrated Guide." Also, avoid using phrases like "click here" or "here" as anchor text.


Including Images in your Documents

<IMG> - In-line Image
Graphical browsers for the Web are able to integrate images with text on an HTML page. This is done using the <IMG> tag. When an image is included on the page with text, it is called an "inline" image. Inline images should be used with extreme caution and should be no more than 10-20 K in size, if possible. You can combine the <IMG> and anchor tag to make small images into hypertext links to other pages or larger images. See the Library of Congress World Wide Web Style Guide for more guidance on using images.


Special Characters

Unlike plain ASCII text files, some special characters may be included in HTML files. Special codes, or entities, exist for using special characters in HTML documents. The code always begins with an ampersand and ends with a semi-colon (e.g., &lt; produces < and &eacute; produces é).

For a list of all entities available for HTML 4.01 see http://www.htmlhelp.com/reference/html40/entities/ on the Web Design Group Site.


Go to:


Library of Congress
Library of Congress Help Desk (October 17, 2000)