Graphics Programs Reference
In-Depth Information
h e very high specii city of the i rst rule (0,2,0,2) is irrelevant to resolving this conl ict of
colors, because the !important trumps it.
Of course, if we add an indication of importance to the i rst rule, then the situation turns out
dif erently.
div#gohome a#home { color : red !important ;}
div a { color : green !important ;}
Because both color declarations are important, the conl ict is resolved using the usual rules of
the cascade. In other words, specii city matters again, so the link will be red.
h is points to the need to be very careful with !important . If you start using it to override
rules, then you might i nd yourself having to override that important rule with other
!important declarations, which then necessitate other !important declarations, and
eventually you end up with all of your declarations being important—which means none of
them are.
We're all familiar with shorthand properties: background , border , font , margin , and
padding are among the most commonly used. h ey're a nice, compact way to express a
bunch of things all at once. But what happens if you leave out some of those things? Consider:
strong { font : bold italic small-caps medium/1.2 Verdana, sans-serif ;}
h at will, as illustrated in Figure 2-3, yield bold italicized small-caps medium-size Verdana
(or other sans-serif ) text with a line height of 1.2 for strong elements.
Figure 2-3: Crazy strong!
Suppose we pare that value back, though:
strong { font : medium Verdana, sans-serif ;}
Search WWH ::

Custom Search