bell notificationshomepageloginedit profileclubsdmBox

10.02% popularity   0 Reactions

I need a clarification regarding the link creation for <ol> list in the HTML page.

Here is the example code for reference.

<ol>
<li>test</li>
<li>test</li>
</ol>

that gives this as output:

test
test

I need to create the links only on the numbers preceding the actual text. Is it possible?


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (2)

Login to follow story

More posts by @Rita

2 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

Earlier in text:

<a name="header1">Header 1</a>

<a name="header2">Header 2</a>

further down...

<ol>
<li><a href="#header1">item one</a></li>
<li><a href="#header2">item two</a></li>
</ol>

If you're making an EPUB book, every tag must be closed, or self-closed.
idiotprogrammer had the syntax right, but the example did not work (for IDPF specs).

<img src="image1.jpg" id="image0001" title="this is self-closed" />


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

@Karen

10% popularity   0 Reactions

Here's a solution which does what you need:

<ol>
<a href="#"><li></li></a>
<a href="#"><li></li></a>
</ol>

(I tried putting a non-breaking space there, but it underlined the space. You could probably use css to set text-decoration: none for the a element.)

If you want the links to go anywhere, you could replace "#" with an anchor URL.

Update: Ahh, I see that the content model doesn't allow A tag underneath OL. So my answer is wrong.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

 

Back to top