Jump to navigation

Fragment Identifiers - iameven.com

- Even Alander

Hyper text has this awesome feature which only a handful of pages seems to implement.

Fragment Identifiers

Not only is it possible to link to a website, but you can also link to a section on a page. If just developers would leave some id attributes for you to select. That is what Wikipedia does in the "Contents" box on almost every page, just look: https://en.wikipedia.org/wiki/Fragment_identifier#Basics

But on a random blog, documentation page (some do), or basically any given random website you're likely to not have that ability. Why is that? I think developer blogs are partially to blame for exactly this, by spreading the rumor that id attributes are bad for your CSS. Then some tool has added that as a rule and suddenly you have a lot of web developers thinking IDs are dangerous to use. And even though that is a good rule for selectors it sort of leaves out when it is OK to use IDs.

On this site I have chosen to expose a link when you hover over the titles, but I'm not expecting everyone to do that. I just want the ability to look at the source and add the ID to the URI when I want to point someone to a specific part of a page. I also expect the id to be URI safe. I don't really think I'm asking too much here. On this site I use a script to add URI safe ID attributes to every header so this is possible to do without having to think about it.

Valid HTML Guitar