View Single Post
Old 02-02-2017, 05:51 AM   #8
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Allow me to start the question with clearer formulation and code again.

To @JSWolf Now we speak about an general coding question!

Click image for larger version

Name:	Files Browser.png
Views:	354
Size:	6.1 KB
ID:	154692
Files Browser Title A & Title B are chapters with headers in <h2> tags. Each chapter includes one second title Aa and one subtitle SubtitleAa (respective Bb & SubtitleBb) in <h2> resp. <h3> tags.

Chapter Title A would look like:
Code:
<body>
  <h2 id="auto1Gen1Code1">Title A</h2> 

  <p>Introducing text</p>

  <h2 id="auto2Gen2Code2">Aa</h2>

  <p>Some text</p>

  <h3 id="auto3Gen3Code3">SubtitleAa</h3>

  <p>More text</p>

  <h2 id="auto4Gen4Code4">End</h2>  

  <p>Closing phrase</p>

<body>
Question: In ereader: How I jump back from header Aa or SubtitleAa to
a) Content or
b) to the respective entry there?
(We don't speak about the auto-generated ToC.)

Quote:
Originally Posted by Turtle91 View Post
Spoiler:
Effectively they will do the same thing. However, the link will point to the element with the ID. <h4 id=...> would link to the <h4> tag, while <a id=...> points to the actual letters themselves. If you have some bizarre css styling it could throw off your result. Such as:

CSS
h4 {margin-top:15em}
or
a {margin-left:75%}

could have the link point to the incorrect page on smaller screens, or the wrong point on the page.
To allow for all possibilities: <hx id=...> instead of <a id=...> !

Quote:
Originally Posted by DaleDe View Post
... while the id generated inside the href statement was probably generated to allow for a return link to allow you to return after the jump.
Exactly!

I think now I have expressed myself clearly.

Last edited by chaot; 02-02-2017 at 06:01 AM.
chaot is offline   Reply With Quote