XML technologies / ePUB / Open Publication Structure / Integrating layout with CSS / Including CSS
(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)
CSS can be included in OPS files in three ways:
1. Directly on the affected element (XHTML/DTBook), using the universal attribute
style. This method is deprecated. Example:
<h1 style="color: #0000FF;">2. XHTML supports embedded CSS applying to the whole document: place the element
<style>in the document head containing styles. Example:
<head><style type="text/css">h1 {color: #0000FF;} . . .</style></head>3. Both XHTML and DTBook reference external stylesheets. XHTML again places a reference in the head’s element
<link>. Example:
<link href="../ebook.css" rel="stylesheet" type="text/css"/>DTBook instead uses a processing instruction, not an XML element, of this form:
<?xml-stylesheet href="dtbook-styles.css" type="text/css"?>
Earlier OPS examples illustrated these methods. All external stylesheets must appear in the manifest (see “CSS in the manifest”).
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