XML technologies / ePUB / CSS essentials / Inheritance rules
(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)
The name Cascading Stylesheets (“cascading”) suggests that inheritance is central to CSS. Inheritance keeps stylesheets compact and manageable.
A property defined for an element passes to its children. For example, a gray CSS background on a <div class="wichtig"> also appears on all contained paragraphs <p>. In practice, this theory still depends on browser or reader implementation.
Current caveats:
Properties of the
bodyelement, useful for global settings such as body font, are often not inherited.
Repeating style information per element is safer when uncertain.
Block properties pass only partly to inline elements, which can be appropriate.
Copyright © mitp 2011
You may print the online version for your private use.
Otherwise, this chapter from “E-Books mit ePUB” is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Verlagsgruppe Hüthig Jehle Rehm GmbH, Im Weiher 10, 69121 Heidelberg, kundenbetreuung(at)hjr-verlag.de
back to top