Site Navigation

Jan 14, 2013

What's an Anchor in HTML5?

Over the weekend I started work on a little side project to make some HTML5 bibles. Because of the detailed information, each verse requires an anchor. In HTML 4, you would do something like this:

<a name="Book01:01"></a>
<p>Verse starts here...


In HTML5, the name attribute is no longer valid. So what to do? When I Googled around on this, all I found was folks using an id attribute in div and hx tags. In this use case, nothing like that would work. The content is much to detailed. So this is what I came up with.

<a id="Book01:01"></a>
<p>Verse starts here...


The anchor tag was always used for anchors and hyperlinks before. This makes sense to me. If you have any better ideas, please give me a shout. But for now, it will be the a tag with an id attribute for me.
Post a Comment

Favorite Links Feed