View Single Post
Old 09-03-2019, 08:38 PM   #15
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Turtle91 View Post
Care to give an example of how to create a link on a number generated when a page is rendered?
Yes, of course. I'm going to write a code that works in both, RMSDK and WebKit. The code for webkit is simpler but with this, it will work everywhere. In the .xhtml file:

Code:
  <ol>
    <li><a class="myN" href="../Text/Section0002.xhtml#N1">*******</a> 

    <p>—How do you do? Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula. Praesent orci dui, pulvinar id convallis a, faucibus non mauris. Donec tellus augue, tempus sed facilisis sed, fringilla quis leo.</p>

    <p>—How do you do?</p>

    <p>—Please a coffe.</p></li>
</ol>
and in the .css file:

Code:
li {
  margin-bottom: 1em;
  margin-left: -0.5em;
  color: red;  /* This is to mimic the format used by the OP */
  font-weight: bold;
}

li p {
  margin: 0em 0em 0em 1em;
  text-indent: -1em;
  color: black;
  font-weight: normal;
}

a.myN {
  float: left;
  margin-left:-2em;
  height: 1.2em;
  text-decoration: none; /* Again, to mimic the format used by the OP */
}
Below I attach an .epub (open it in ADE) so you can watch better how work the links in numbers of an ordered list.

Regards
Rubén
Attached Files
File Type: epub Links in OL.epub (3.4 KB, 374 views)
RbnJrg is offline   Reply With Quote