Skip to a section of this page:

Anchors away!

Anchors, be gone!.. Named anchors, at least.

I’m not a fan of linking to named anchors (for example: <a name="point-a"></a>). They limit you to identifying a point in the document, or at best some link text.

Its much more powerful to link to a section of a page using the id attribute on an element that contains the content you’re referring the user to.

For example:

<div id="section-a">
	<h2>Section A</h2>
	<p>Some content worth linking to...</p>
</div>

In this case when you link to the fragment-identifier #section-a you are signifying that the user should read the entire section of content.

But how can the user tell the difference?

Usually, they can’t! (only those who understand HTML and look at the code can tell).

That’s where Frag Link highlighter can help. After the user follows a link to a page fragment, Frag Link briefly highlights the section of content that was linked to.

It also helps in situations when the browser has scrolled all the way to the bottom of the page and the section in question still isn’t at the top of the viewport. The brief flash of colour can draw users’ attention to the relevant content.

Frag Link can also help draw attention to part of a page when no scrolling is involved or when there is more that one column of content.

Give the Frag Link demo a try and tell me what you think.

2 Responses to “Anchors away!”

Comment feeds for this post:

  1. Hugh Barnes Says:
    “Users confused? FLH to the rescue!” Great marketing skills. Now I see what you’ve been up to this weekend! This is an interesting idea. I tried out the demo from the internal browser of Akregator, which is set to render with Konqueror’s engine. The highlighting seemed very quick to me. On occasion, I must have missed it because the browser was so slow to jump to the fragment – “if a tree falls …” and all that. Probably 50 tabs or so aren’t helping any. (ooh, quick clarification edit: not pills!) I just looked at the source to see what the flashing duration was, and it shows a whole second. Hmm. Might be nice to be able to set this with a proper parameter. Now, I suspect this has occurred to you already: I see this ultimately as a piece of user agent functionality, whether built-in, plug-in, or user script (probably the preferred option). I don’t think it will reach its full potential as site-specific experience candy, though this is a fine incubation environment. Does any of that make sense? Well done, AR! I like, I like.
  2. Andrew Says:

    Great marketing skills

    Thanks!

    Might be nice to be able to set this with a proper parameter.

    Agreed. Proper configuration options would be good… Road-mapped!

    The highlighting seemed very quick to me. On occasion, I must have missed it

    That’s a good point. I was thinking that it may even be better if the highlighting remained (at least until another fragment is selected).
    Perhaps this behaviour should be configurable too.

    I see this ultimately as a piece of user agent functionality, whether built-in, plug-in, or user script

    Yes, I agree to a point. You probably realise I have alterior motives. By making this a site-specific enhancement it will encourage authors to link to page sections rather than anchor points.
    Creating a browser plugin / user script may have the same effect over time though.
    Hmmm… food for thought.

    Does any of that make sense? Well done, AR! I like, I like.

    Yes, all good points. Thank you.
    You should probably steer clear of those tabs though ;)

Leave a Reply