HyperText Markup Language (HTML) Quick Reference
Part 1 - Basic Tags - Version 3.6

Concepts

  1. Content (HTML tags) vs Presentation (Style Sheets) vs. Functionality (JavaScript)
  2. Block-level tags vs. inline tags.
  3. Paired tags (aka container tags) vs. unpaired tags
  4. Meta-tags - tags that describe the file, but don't format text.
  5. Tags vs elements (an opening tag, content, and closing tag)
  6. "Deprecated" items, which are officially being retired, and "functionally deprecated" items.
  7. Cascading Style Sheets (CSS) & inheritance
  8. Tables vs style sheets for layout
  9. Absolute positioning of div's and tables - problematic.
  10. [url]: Fully qualified (w/ http://), root-relative (starts with /), or relative (may use . and ..).
    URL's may include query string parameters (offset with "&" and "&"), and anchors (offset with "#").
  11. [color]: May be expressed as six hex digits, 3 hex digits, or names. - See Color Chart
  12. [size]: Applies to style sheet and HTML attributes that define fonts, borders, padding, element width, or height, etc. Sizes may be
    • Fixed # of px, pt, in, mm, cm, or pc. (Points (pt) are 1/72nd inch. 1 Pica (pc) is 12 points.)
    • Borders can be also be expressed as "thin", "medium", or "thick".
    • % of current font size or containing object size, as appropriate,
    • Number of "em's", in decimal notation, where 1.0 em = height of current font size, or
    • Number of "ex's", where 1.0 ex=height of lowercase x in current font size.
  13. [fontsize]: {size) as above, or font size #'s (1-6; 1=smallest), or relative font size # (-5 thru +5)
  14. <!---HTML comments --> and /* Style Sheet Comments */ may span lines and include HTML or CSS code, and may not be nested. (i.e. the first closing string closes the comment, despite intervening opening strings.)

GENERAL DOCUMENT MARKUP

Prototype HTML Page
<html>
  <head><title>Page title</title>
    <!-- header tags & metatags -->
    <style> /* style defs */ </style>
  </head>
  <body>
  <!-- Content & HTML content tags -->
  </body>
</html>
<!DOCTYPE > Metatag that defines the language and parsing formality. (Not a container)
<html> </html> Beginning and end of HTML document. Contains only <head> and <body>
<head> </head> Contains the HTML header (NOT content!)
<meta> Header tag to describe document for search engines, etc. (Generally not containers.)
<title> </title> Header tag; Provides a title for the browser window
<style> </style> Contains style definitions - should be in the header
<body> </body> Contains the content of the HTML document.
<script> </script> Contains scripts (typically JavaScript) - ideally in the header

BLOCK-LEVEL TEXT FORMATTING

<h1> </h1>;<h2> </h2>; etc. Heading sizes. 1 is largest; 6 the smallest. 1, 2, and 3 are most common.
<p> </p> Paragraph. Typically provides blank line before and after the text.
<br />
<br clear=[margin] />
Line Break; forms a new line with no blank line. Not a container. [Margin] is (left, right, all).
<hr /> Horizontal Rule (inserts a line across the page). Not a container. Attributes include width, size, color, and align. (Style sheets are preferred for all).
<pre> </pre> Preformatted Text- Preserves spaces, tabs, and carriage returns, but does process tags.
<center> </center> (Use <div> with styles instead)
<div> </div> "Division" - Generic Container tag for applying styles and identifying text blocks

INLINE TEXT FORMATTING

<b></b> <strong></strong> Bold. Note that <b> represents presentation; <strong>represents structure.
<emphasis></emphasis> Typically bold; may italicize
<i> </i> Italics. Use {font-style:italic} instead.
<u> </u> Underline. Gets confused with hyperlinks. When really needed, use {text-decoration:underline} instead.
<code></code> Contains "code" - HTML code, program code, etc. Displayed in a monospace font.
<font></font> Font size, face, and color changes (Use <span> instead)
<big></big><small> </small> Relative font size changes
<span> </span> Generic tag for applying styles

LISTS

<ul> <li></li> </ul> Unordered List- bullet points are placed next to each list item (<LI>)
<ol> <li></li> </ol> Ordered List- numbers next to each list item
list-style-type:[styletype] For <ul>: [disk | circle | diamond |etc.] - The web browser will select different symbols at different indentation levels.
For <ol>: [ decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none | etc.]
list-style-image:url([url]) Use image in place of shape for <ul>
list-style-position:[position] outside or inside. Beware of browser differences.
<dl> <dt> <dd> </dl> Definition List- definitions (<dd>) are placed under defined terms(<dt>)

Unordered List Ordered List Definition List
<ul>
    <li>Bulletted list item
    <li>Bulletted list item
    <li>Bulletted list item
</ul>
<ol>
    <li>Item #1
    <li>Item #2
    <li>Item #3
</ol>
<dl>
    <dt>Term
        <dd>Definition
        <dd>Definition
</dl>

IMAGES

<img src =[url]>Image Source- Inline picture.
align=[direction]Defines how text floats around the image. Use style sheet float attribute.
height=[distance] width=[distance]Display size of image. May be different from the actual size. Can distort the image if the dimensions don't match. Style sheet height and width attributes do not apply.
border=[length]Width of border. Border will use link colors if image is a link.
hspace=[space] vspace=[space]Space outside of border. (Use padding CSS attribute instead.)
<img src =[url] ismap usemap=#[anchor]>Clickable Image. Refers to an imagemap.
<map name=[anchor]> </map>The Image Map, which defines hot (i.e. linked) areas.
<area shape=[shape]
coords="[coords]" href="[url]" />
One hot area of within an Image Map. (Not a container.)

Image Map Example - Showing the mapping for 3 active areas of the map at www.clevelandclinic.org/maps/campus.htm

<img src="campusmap.jpg" border="0" usemap="#maincampusMap" ismap alt="Campus Map">
<map name="maincampusMap">
   <area shape="rect" coords="577,248,623,332" href="buildings.asp?building=a" alt="Crile Building">
   <area shape="rect" coords="830,384,871,400" href="buildings.asp?building=b" alt="Imaging Center">
   <area shape="poly" coords="322,532,327,422,402,423,402,491,382,489,379,533" href="buildings.asp?building=l" alt="Lab Building">
</map>

Resources