Prev | Current Page 110 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"

75
ems and the a elements nested down inside are set to .7 ems. The
net result is that text in those a elements ends up displaying at .525
ems (.7 ?— .75). Inheritance of font sizes can work for you, and, as
here, against you. Fortunately, the ?¬? x is easy??”you simply set a contextual
selector for this speci?¬? c situation, like this

Note we don??™t style the a element, but simply let it inherit its font
size from its containing element, which is p in some cases and ol in
others. In the case of the ol links, the a inherits from the li which
inherits from the ol.
So you can see from these two comments that it makes sense to set
the size of text at the highest level possible and then make adjustments
by working your way down the document hierarchy, setting
sizes at the highest level possible as you go. In other words, don't
start with those highly nested links, but style text sizes top-down
from the body tag. This minimizes the number of font-size rules you
have to write, and maximizes the advantages of the Cascade.
You can now test the scalability of your ems-based layout:
1.


Pages:
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122