Organizing Text In A Document


Organizing Text in a Document

There is no universal agreement on how HTML tags should be classified or categorized. Almost every guidebook on HTML uses a somewhat different grouping system to class the different tags.

The tags listed in this section are organized - for the most part - on the basis of the classification system used in the HTML 4.01 Specification published by the World Wide Web Consortium. Each tag is listed with a definition and an example (with an illustration of code). Because I deal with images, hyperlinks, tables, frames, and forms in other sections of this site, this page will focus on tags normally applied to or around text.

[Structured Text: Phrase Elements]
[Structured Text: Quotations]
[Structured Text: Subscripts and Superscripts]
[Lines and Paragraphs: The P Element]
[Lines and Paragraphs: Controlling Line Breaks]
[Lines and Paragraphs: Hyphenation]
[Lines and Paragraphs: Preformatted Text - The PRE Element]
[Lines and Paragraphs: Visual Rendering of Paragraphs]

Structured Text: Phrase Elements

  • <EM> - Emphasis - This is placed around text that should be emphasized. Web browsers will usually render the marked text in italics.

    This is very important!
    This is <EM>very</EM> important!

  • <STRONG> - Strong Emphasis - This is placed around text that should be given great emphasis, and it can be used in conjunction with the <EM> tag. Web browsers will usually render the marked text in boldface type.

    This is extremely important!
    This is <STRONG>extremely</STRONG> important!

  • <CITE> - Citation - Used to denote a citation reference, usually within the text (e.g., within a paragraph). Commonly rendered in italics by web browsers.

    Our definitions were taken from the Oxford English Dictionary and other sources.
    Our definitions were taken from the <CITE>Oxford English
    Dictionary</CITE> and other sources.

  • <DFN> - Definition or Defining Instance - This tag is typically applied to special terms or phrases that are being defined in the context of a document; most often the terms are marked with the <DFN> tag the first time they appear. Web browsers do not always give <DFN> tagged text a special rendering, but the tag can be very helpful if you want to build an index or glossary for your document using the marked terms.

    DSL (Digital Subscriber Line) is a technology for bringing high-bandwidth information to homes and small businesses over ordinary copper telephone lines.
    <DFN>DSL (Digital Subscriber Line)</DFN> is a technology
    for bringing high-bandwidth information to homes and small
    businesses over ordinary copper telephone lines.

  • <CODE> - Typed Code - Use this tag when you want to present a sample or illustration of typed computer code within your document. Most often web browsers will render the tagged text in a monospaced font like Courier that is common in command-line computer interfaces.

    The expression #!/usr/bin/perl is commonly used at the beginning of scripts written in the Perl language.
    The expression <CODE>#!/usr/bin/perl</CODE> is commonly
    used at the beginning of scripts written in the Perl language.

  • <SAMP> - Sample Output - This tag marks text you want to identify as a series of literal or sample characters. You might want to use the tag if you present an example of output from a computer command or program. Like the <CODE> tag, text marked with the <SAMP> tag is usually rendered in a monospaced font.

    If, after typing your command, the system returns a message stating Request Denied, please call technical support.
    If, after typing your command, the system returns a message
    stating <SAMP>Request Denied</SAMP>, please call technical support.

  • <KBD> - Keyboard Input - A useful tag for marking text in technical documentation. Use the <KBD> tag to identify computer commands that users can enter on keyboards. The web browser will usually render such text in a monospaced font.

    In the UNIX operating system, type ls -la at the system prompt to see a complete list of files in your home directory.
    In the UNIX operating system, type <KBD>ls -la</KBD> at the system
    prompt to see a complete list of files in your home directory.

  • <VAR> - Variable or Program Argument - Yet another tag relevant for illustrating examples of computer programming and command code. The <VAR> tag is intended to denote text that serves as a variable name or a user-supplied value, and it is usually rendered in a monospaced font. The example below illustrates a user-supplied value for an attribute in an HTML tag.

    To specify a background color for the body of an HTML document, use the BGCOLOR attribute of the BODY tag

    <BODY BGCOLOR="#color">

    and supply a value for color in the BGCOLOR attribute of the BODY tag.
    To specify a background color for the body of an HTML document,
    use the BGCOLOR attribute of the BODY tag <BODY BGCOLOR="#<VAR>color</VAR>"> and supply a value for <VAR>color</VAR> in the BGCOLOR
    attribute of the BODY tag.

  • <ABBR> - Abbreviation - Used to mark text that represents the abbreviated form of a longer term or phrase. The <ABBR> tag was introduced with Version 4.0 of HTML and was not immediately supported by the major web browsers. Note how the TITLE attribute can be used in this tag to provide the full name for which the abbreviation stands

    amen int., adv., n., & v.
    amen <ABBR TITLE="interjection">int.</ABBR>,
    <ABBR TITLE="adverb">adv.</ABBR>, <ABBR TITLE="noun">n.</ABBR>,
    & <ABBR TITLE="verb">v.</ABBR>

  • <ACRONYM> - Acronym - Used to mark text that represents the acronym form of another term. As with the <ABBR> tag, <ACRONYM> takes a TITLE attribute which can be used to provide the full name for which the acronym stands

    ASCII is the most common format for text files in computers and on the Internet.
    <ACRONYM TITLE="American Standard Code for Information
    Interchange">ASCII</ACRONYM> is the most common format for text
    files in computers and on the Internet.


Structured Text: Quotations

  • <BLOCKQUOTE> - Blockquote - A "block" formatting tag used to enclose long quotations that should be set off with indentation and a line break.

    Here is an example.

    Blockquotes are generally indented, to set them off within paragraphs.
    That's it!

    Here is an example
    
    <BLOCKQUOTE>Blockquotes are generally indented,
    	to set them off within paragraphs.</BLOCKQUOTE>
    
    That's it!
  • <Q> - Quotation - The <Q> tag is distinguished from the <BLOCKQUOTE> tag by the length and role of the quotation. If your intent is to denote short quotations that don't require line breaks or indentation (i.e., if the quotations can be placed directly into the text, as is often the case with newspaper stories), then the <Q> tag is recommended. The attribute CITE allows you to provide the source of the quotation, and the attribute LANG allows you to specify the language used for proper rendering of quotation styles.

    Mary said, When I left the office, Larry said Thanks for all your help today. I found that pretty gratifying.
    Mary said, <Q lang="en-us">When I left the office, Larry said 
    <Q lang="en-us">Thanks for all your help today.</Q> I found that pretty gratifying.</Q>

Structured Text: Subscripts and Superscripts

  • <SUB> - Subscript - This tag is used to mark text that should be rendered by the browser in subscript format. It's commonly used for mathematical and other expressions.

    X2 + Y3 = Z4

    X<SUB>2</SUB> + Y<SUB>3</SUB> = Z<SUB>4</SUB>


  • <SUP> - Superscript - This tag is used to mark text that should be rendered by the browser in superscript format. Like <SUB>, it's often used in mathematics (e.g., for exponential expressions) and for things like note markers.

    As Davis36 argued in his article....

    As Davis<SUP>36</SUP> argued in his article....


Lines and Paragraphs: The P Element

  • <P> - Paragraphs

    This may look like a sentence, but I'm calling it a paragraph.

    <P>This may look like a sentence, but I'm calling it a paragraph</P>


Lines and Paragraphs: Controlling Line Breaks

  • <BR> - Line Break - A very useful tag within paragraphs, <BR> is used whenever you want the browser to force a break in a line of text. In effect, it gives you the same result as a carriage return on a typewriter or a word processing program.

    He who binds himself to joy
    Doth the winged life destroy
    But he who kisses the joy as it flies
    Lives in Eternitys sun rise

    - William Blake
    	He who binds himself to joy<BR>
    	Doth the winged life destroy<BR>
    	But he who kisses the joy as it flies<BR>
    	Lives in Eternitys sun rise<BR><BR>
    	<CITE>- William Blake</CITE>
    	

Lines and Paragraphs: Hyphenation

    This section is under construction

Lines and Paragraphs: Preformatted Text - The PRE Element

    This section is under construction

Lines and Paragraphs: Visual Rendering of Paragraphs

    This section is under construction

Richard K. Kearney, M.L.S.
Reference Librarian / Electronic Resources
David and Lorraine Cheng Library
William Paterson University
Wayne, New Jersey 07470

Last Revised: May 31, 2002