HTML and CSS Reference
Figure 5-4. The long and short of absolute and relative
The following rules are 40 and 320 pixels wide no matter
the actual width of the browser window:
Whereas these next two rules will always extend across
10 and 75 percent of the window, regardless of its width:
Notice, too, that the relative (percentage) value for the width attribute
is enclosed in quotation marks; the absolute (integer) pixel value is not.
In fact, the quotation marks aren't absolutely necessary with standard
HTML (though they are required for XHTML). Further, because the per-
cent symbol normally means that an encoded character follows it, failure
to enclose the percentage for the width value in quotation marks may
confuse some browsers and trash a portion of your rendered document.
In general, it isn't a good idea to specify the width of a rule as an exact
number of pixels. Browser windows vary greatly in their width, and what
might be a small rule on one browser might be annoyingly large on an-