homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Accessibility and Usability
Forum Library, Charter, Moderators: ergophobe

Accessibility and Usability Forum

Be Specific, Use Fragment Identifiers
On page targeting for users.

 5:06 pm on Apr 25, 2008 (gmt 0)

Fragment Identifiers

I posted that original topic in 2007 March. It didn't get much play at that time. I'm hoping to spark a little more conversation this time around about the use of Fragment Identifiers.

There's a recent topic that caused me to bring this up. onedodd wants to know how they can take a user to a specific section of a page on another domain within a <iframe>.

<iframe> Scrolling
Scrolling to bottom of page.

What a perfect opportunity to bring up Fragment Identifiers. If the third party page they want to reference within their <iframe> utilizes Fragment Identifiers, they can easily do this and put the user right at the area they need to be...

<iframe src="http://www.example.com/charts/#SeaWater"></iframe>

Now, if that third party page does not have a specific fragment to identify that section, I can search around to see if there is anything close by that has an ID I can reference to put the user as close as possible to that chart. While not the best solution, it does get them closer to the target. The ultimate scenario would be something like this...

<h2 id="SeaWater">Sea Water Chart</h2>

If that is what resided on that third party page, I could now take my <iframe> src URI and do this...

<iframe src="http://www.example.com/charts/#SeaWater"></iframe>

Putting my visitor right at the Sea Water Chart on the third party domain that is being displayed within that <iframe></iframe> on my site.

All sites that I develop these days have IDs on all <h> elements. Since the pages are structured semantically, I can put a user right at a specific section on any page at any time by using a Fragment Identifier. When I reference "user", I'm referring to "all users". I've found that marketing folks love this feature as they can target specific areas of pages when making changes, explaining things to their clients, etc.

Ever get an email and need to send someone to a page on a website somewhere? And that page was fairly dense with content? Wouldn't it be nice to just send them a link to the area they might be interested in? Maybe its an FAQs page and you need to send them to FAQ #11. My FAQs page might utilize the <dl> element so I'm going to have IDs assigned to each of the <dt>s within. :)

Are you using them? How have they benefited you? What have you called them? I know the term "Fragment Identifiers" might be a bit alien to some. Years ago I may have called them "Named Anchors" but the name attribute has been deprecated in favor of IDs.



 8:46 pm on Apr 28, 2008 (gmt 0)

One of my pet peeves is clicking on a link for "widgets" from a marketing email or search engine listing and landing on a page that's about something other than widgets, except for one reference down at the bottom of a long page.

To prevent such a waste of time for my sites' visitors, I have used fragment identifiers to quickly land them at specific information on a page. I use them mainly in email marketing, on FAQ pages, and to break up pages that are dense in content. Now that you mention it, I'm sure they also make it easier for third parties to link to specific information on my sites as well.

I have called fragment identifiers "anchor" links until I was recently corrected to the proper lingo. My intranet software's HTML editor also refers to them as anchors. :)


 9:55 pm on Apr 28, 2008 (gmt 0)

Welcome to WebmasterWorld MichelleStute


 10:23 pm on Apr 28, 2008 (gmt 0)

Welcome to WebmasterWorld Michelle. :) I would agree that fragment identifiers can be a usability aid in terms of on-page navigation. I would add that they are ideal hooks for on-page keyboard navigation added for accessibility reasons - "skip to menu" or "skip to content" links can quickly be added referencing the appropriate

It can be overdone, however - fragment identifiers are not a replacement for non-semantic elements, and it is always important to consider splitting the content over several pages rather than depending on fragment identifiers to navigate an overly-large document.


 3:39 am on Apr 30, 2008 (gmt 0)

welcome to WebmasterWorld [webmasterworld.com], MichelleStute!

i think they are often called anchors because a "named anchor tag" can be used as a fragment identifier.
<a name="label">


 10:49 am on May 14, 2008 (gmt 0)

i think they are often called anchors because a "named anchor tag" can be used as a fragment identifier.

Ah-ha, but the Name Attribute has been deprecated on certain elements in XHTML like the a element, hence the use of the term Fragment Identifiers and the use of ID vs NAME. ;)

I've heard them referred to as; Named Anchors and Bookmarks. FrontPage used to call them Bookmarks in the WYSIWYG menus and assign the "a" attribute when used. I know, that term Fragment Identifier throws quite a few off as they've not heard that used in this instance. That is the official terminology for this particular topic. Kind of like how URI has replaced URL but most still use URL. ;)

Welcome to WebmasterWorld MichelleStute!


 3:08 pm on May 21, 2008 (gmt 0)

I think they are often called "named anchors" because that was the original terminology and continued use of that term by the authoritative bodies kept it alive ;)

This attribute is used to define a named anchor for use as the destination of hypertext links. For example, the following defines an anchor than can be used as the destination of a jump into a description of the Boston area.

The <A NAME="potomac"&gtPotomac river</A> flows into Boston harbour.

Note: the NAME attribute has been superceded by the ID attribute. User agents should include support for NAME to ensure backwards compatibility with legacy documents produced using previous versions of HTML.

Source: HTML 3 Specs

So, although it was superceded back in HTML3, the use of the phrase continued as it carried over into HTML 4.01 a tad (search for "named anchor" on this page):
... and note "fragment identifier" use there as well!

Ah-ha, but the Name Attribute has been deprecated on certain elements in XHTML like the a element, hence the use of the term Fragment Identifiers and the use of ID vs NAME.

Ah yes, deprecated, but not removed. Why? Because certain user agents didn't get it right and the W3 knew this when they delivered the standard:

Many existing HTML clients don't support the use of ID-type attributes in this way, so identical values may be supplied for both of these attributes to ensure maximum forward and backward compatibility (e.g., <a id="foo" name="foo">...</a>).


I recall assisting others with issues in regards to using the id attribute as opposed to the name attribute (or both as mentioned in the standard), but said assistance may have been some time ago now. Can anybody recall the last browser version of the majors that did NOT support id as a fragment identifier correctly?


 6:36 pm on May 21, 2008 (gmt 0)

Sorry, just realized I was the only one in this thread that had not welcomed MichelleStute yet ;-)

Welcome to WebmasterWorld MichelleStute!


 3:36 am on Jun 22, 2008 (gmt 0)

but the Name Attribute has been deprecated on certain elements in XHTML like the a element

I well remember when id had almost no support. Truth be told, until quite recently I have stayed with <a name=""> It may be deprecated, but still validates with W3C, so I've been pretty lax in changing my ways - and I use 'name' (now id) anchors pretty extensively. A big plus to point to an exact point on a page, even if it's not that large. You used to have to surround the <a> with a <p> or <div>. Looks like that has gone away as well. Used to always get something like '<a> not allowed here. Must be enclosed by...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

Welcome to WebmasterWorld MichelleStute:))

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Accessibility and Usability
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved