XML technologies / ePUB / ePub für (In)Designer / Images, boxes and other design elements / Wrapping text around images and boxes / Help! I forgot text wrapping and the object style!
(Excerpt from “ePub für (In)Designer — Mit InDesign Schritt für Schritt zum E-Book” by Sascha Heck & Yves Apel)
Have you already prepared the final ePub and made numerous changes to its HTML and CSS code, but forgotten wrapping and object styles for images? As in a famous novel, our advice is:
Figure: Don’t panic.
You will probably see something like this:
Figure: Starting situation with image wrapping and object styles forgotten.
Open the relevant HTML file in an editor and find the code beginning with <div class="group">.
<div class="group">
<div class="image">
<p class="para-style-override-2"><img width="109" height="204" src="images/125px-Katana-_Klinge_fmt.jpeg" alt="125px-Katana-_Klinge.jpg"/></p>
</div>
<div class="story">
<p class="impressum para-style-override-3"><span>Querschnitt durch die Klinge eines Katana.</span></p>
</div>
</div>In the first line, replace the word “group” with a name of your choice, for example <div class="umfliessen">.
<div class="umfliessen">
<div class="image">
<p class="para-style-override-2"><img width="109" height="204" src="images/125px-Katana-_Klinge_fmt.jpeg" alt="125px-Katana-_Klinge.jpg"/></p>
</div>
<div class="story">
<p class="impressum para-style-override-3"><span>Querschnitt durch die Klinge eines Katana.</span></p>
</div>
</div>Switch to the CSS file (template.CSS) and append these lines at the very end:
div.umfliessen {
float: left;
width: 150px;
margin: 3px 12px 12px 0;
}where the code float: left; or float: right; specifies image placement on the left or right. Your chosen name must follow “div”.
That is all: in each HTML file, change the line for each image to <div class="umfliessen">.
Copyright © dpunkt.verlag GmbH 2012
You may print the online version for your private use.
Otherwise, this chapter from “ePub für (In)Designer” 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.
dpunkt.verlag GmbH, Wieblinger Weg 17, 69123 Heidelberg, fon 06221-14830, fax 06221-148399, hallo(at)dpunkt.de
back to top