XML technologies / ePUB / ePub für (In)Designer / Brief introduction to HTML and CSS / HTML
(Excerpt from “ePub für (In)Designer — Mit InDesign Schritt für Schritt zum E-Book” by Sascha Heck & Yves Apel)
HTML (Hypertext Markup Language) is markup for structuring text, images and links, and the web’s foundation. Browsers interpret and display it. HTML files are plain text, viewable in an ordinary editor. The World Wide Web Consortium (W3C) continually develops HTML. The forthcoming HTML5 matters greatly to publishing; some devices and applications already implement parts, discussed later.
Tags
How does HTML relate to InDesign? We structure documents with paragraph and character styles, identifying titles, body text and captions. InDesign converts this information during ePub export into HTML tags, usually an opening and closing pair. A normal paragraph looks like this:
<p>Ich bin ein normaler Text</p>This is an element. Its opening tag has, for example, p for paragraph between angle brackets; its closing tag adds a slash after the opening bracket. This is the basic principle for all elements.
Empty elements have neither closing tag nor content. Common ePub examples are <br> (break, line break), <hr> (horizontal rule, rule) or <img> (image, image).
Standard heading tags range from h1 to h6. The h means heading, distinguishing main titles from subheadings:
<h1>Ich bin die Hauptüberschrift</h1>
<h2>Ich bin nur der Untertitel</h2>
<p>Ich bin dann der Haupttextteil …</p>Tags may nest. To emphasize a word, use italic (<em>, emphasis) or bold (<strong>, strong), defined as follows:
<p>Ich bin ein normaler Text, aber dieses <em>Wort</em> wird jetzt kursiv gesetzt und <strong>das</strong> wird fett ausgezeichnet.</p>div tag
The div tag occurs in boxes or anchored objects. It contains other HTML elements, grouping logically related content for visual distinction through CSS. Think of a div element as an invisible content area. Opening and closing <div> tags each create line breaks.
<div class="kasten">
<p class="text">Manche Klingen erhalten dann beim Graveur noch eine Dekoration (Horimono).</p>
</div>Attributes
Tags accept additional parameters, attributes, supplying properties. Images provide a typical example:
<img width="300px" height="150px" src="meinBild.jpg"/>width and height set image dimensions. The src attribute (source) specifies the image-file path.
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