Skip past header
Nevada Department of Transportation Go to State of Nevada Homepage
Jim Gibbons
Governor
Susan Martinovich, P.E.
Director
 

Example 17. Relative rather than absolute units


17. Use relative rather than absolute units in markup language attribute values and style sheet property values. (508:None. W3C 3.4.)

Techniques:

Example.

Use em to set font sizes, as in:

   H1 { font-size: 2em }

rather than:

   H1 { font-size: 12pt }

End example.

Example.

Use relative length units and percentages.

   BODY { margin-left: 15%; margin-right: 10%}

End example.

Example.

Only use absolute length units when the physical characteristics of the output medium are known.

   .businesscard { font-size: 8pt }

End example.



1263 South Stewart Street, Carson City, Nevada 89712 - Telephone: 775-888-7000 - Fax: 775-888-7115 - Email: info@dot.state.nv.us
Copyright © 1998 - 2008 Nevada Department of Transportation
Valid HTML 4.01! Valid CSS!