Basic HTML data types 

Contents

  1. URLs
  2. Character data
  3. Colors
    1. Notes on using colors
  4. Lengths and Pixels

URLs 

The type "url" refers to either an absolute or relative Universal Resource Locator. Please consult the section on URLs for more details.

Character data 

The syntax of valid character data in HTML is defined in terms of the SGML concepts of NAME and CDATA. For more introductory information about SGML, please consult the SGML tutorial. For more information about SGML, please consult the SGML handbook ([GOLD90]).

Colors 

The attribute value type "color" refers to color definitions as specified in [SRGB]. A color value may either be a hexadecimal number (prefixed by a hash mark) or one of the following sixteen color names:

Color names and sRGB values
Black = "#000000" Green = "#008000"
Silver = "#C0C0C0" Lime = "#00FF00"
Gray = "#808080" Olive = "#808000"
White = "#FFFFFF" Yellow = "#FFFF00"
Maroon = "#800000" Navy = "#000080"
Red = "#FF0000" Blue = "#0000FF"
Purple = "#800080" Teal = "#008080"
Fuchsia = "#FF00FF" Aqua = "#00FFFF"

Thus, the color values "#800080" and "Purple" both refer to the color purple.

Notes on using colors 

Although colors can add significant amounts of information to document and make them more readable, please consider the following guidelines when including color in your documents:

Lengths and Pixels 

Values of the type "length" may either be specified as an integer representing the number of pixels of the canvas (screen, paper) or as a percentage of the available horizontal or vertical space. The HTML DTD generally uses %Length for length values that permit percentages and %Pixels for values that only permit pixels.

Thus, the value "50" means fifty pixels. For widths, the value "50%" means half of the available horizontal space (between margins, within a table cell, etc.). For heights, the value "50%" means half of the available vertical space (in the current window, the current table cell, etc.).

For normative information about the definition of a pixel, please consult [CSS1].