XML technologies / ePUB / ePub für (In)Designer / Creating and editing hyperlinks / Creating text anchors and links

(Excerpt from “ePub für (In)Designer — Mit InDesign Schritt für Schritt zum E-Book” by Sascha Heck & Yves Apel)

Creating anchors, hyperlinks and references in InDesign was covered under Cross-references and links. In HTML too, first create an anchor and then a hyperlink to it.

Setting text anchors

Go to the desired text position, for example a chapter title:

<h1 class="Titel">1) Geschichte der Entwicklung</h1>

Add id="Textanker" to set the anchor:

<h1 class="Titel" id="IhrTextankername">1) Geschichte der Entwicklung</h1>

Setting anchors in HTML

Figure: Setting anchors in HTML.

Creating HTML hyperlinks

Hyperlinks use this syntax:

<a href="MeinLinkziel">Mein Hyperlink-Text</a>

Reference the XHTML file, then the anchor after the hash sign (#), without spaces. The anchor must match its original spelling exactly.

<a href="../Text/Datei.xhtml#IhrTextankername">Hier kommt der Text Ihres Hyperlinks hin</a>

  

 

 

 

back to top