Graphics Programs Reference
In-Depth Information
Another common example of selectively overriding shorthands would be with headings,
which might have a great deal in common except for the font sizes. If you're satisi ed with the
browser-default font sizes, then you can just do this:
h1 , h2 , h3 , h4 , h5 , h6 { font-weight : normal ;
font-style : italic ;
font-family : Helvetica, sans-serif ;
line-height : 1.5 ;}
If, on the other hand, you're going to be setting your own heading sizes, as in Figure 2-6, then
l ip it around:
h1 , h2 , h3 , h4 , h5 , h6 { font : italic 100%/1.5 Helvetica, sans-serif ;}
h1 { font-size : 225% ;}
h2 { font-size : 185% ;}
h3 { font-size : 140% ;}
/* …and so on */
Whenever you do this kind of selective overriding, it's a good idea to make sure the overrides
come at er the shorthand. h at way, if (as is ot en the case) the selectors have equal specii city,
then the overrides will win out over the shorthands.
48
Figure 2-6: Quick header sizes with selective overriding.
 
Search WWH ::




Custom Search