Entry: Post

Entry Module
Entry

Jumping to Chapters Using IDs in Anchor Tags

Post Header Aside
Comments Actions Snippet
Comments Population
Comment Creation Ability
Post Content
Chapters - Anchor Links - Time
A screenshot of a Time article showing the Chapters in anchor links.

Here’s what I particularly like about Time articles – the Chapters are neatly lined up on top in anchor links. In case you want to jump from one part of an article to another.

TearSheet

The simplest way to implement this is to use the id of the element and put that into the href attribute of your a element.

For example:

[code lang=”html” title=”HTML”]
<!– Activating this link will jump to Chapter Title 1 –>
<a href="#chapter-title-1">Chapter Title 1</a>

<!– Chapter Title 1 –>
<h2 id="chapter-title-1">Chapter Title 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
[/code]

You can see a demo here:

See the Pen heoAl by Brian Dys Sahagun (@BrianSahagun) on CodePen.1820

Comment Module
Comments
Comments Header Aside
Comments Actions Snippet
Comments Population
Comment Creation Ability

There are no comments.

Comment Creation
Comment Author Comment Creation
Comment Author Name Creation
Comment Author Email Creation
Comment Author Website URL Creation