How to insert hyperlink in table of contents HTML

How to insert hyperlink in table of contents HTML: by adding hash hyperlink to table of contents entry and adding hash id to post heading, you can insert hyperlink in TOC.

Table of contents without hyperlinks not became more effective and not creates "Jump to" effect. For make your TOC heading text clickable, you need to add anchor tag with heading tag link up.

How to link table of content text with headings: Internal page link possible using hash(#) id link. Add id to your heading and add that id as link value with # prefix.

<ol>
    <li>
        <a href="#Heading_level_1_entry_1">
        Heading level 1 entry 1
        </a>
    </li>
</ol>

<h2 id="Heading_level_1_entry_1">Heading level 1 entry 1</h2>

TIP:Replace space to underscore(_) in heading text and use it as heading id value.

No comments: