Watching the World

My Newest Discovery About the Oldest Tag

A Wordy Aside From The Usual Pictorial Piffle

It occurred to me a few years ago that I wasn't putting many internal links on websites (i.e. links within the site), so I made a point of looking out for opportunities to add more. Now I'm satisfied that I've used a sensible amount, I wonder instead if I use enough internal links on web pages (i.e. links within the same page).

I suspect that in-page links are something I rarely use simply because most pages that I edit are too short to need them. Often the section linked to is either at the top of the page, or its heading is already visible on the page. Then, a few weeks ago, a friend asked me to add a postscript to a long page (25k of text!), which set me thinking.

In sympathy with visitors who had already read the quite large page, I didn't want them to have to scroll through several screens to get to the new bit. An internal link at the top of the page seemed like an obvious way forward (well, downward), so I refreshed my memory of the #name syntax, and off I coded. It worked perfectly - but looked terrible!

The problem was that the postscript heading was styled one way, but the inclusion of an anchor changed it to the link styling, which looked totally out of place. My first thought was to re-write the style sheet to include an anchor within a heading in the heading styles, but then whilst idly flicking through HTML, XHTML & CSS I spotted the tip:

"The id attribute automatically turns the element into an anchor, to which you can direct a link."

I'd never thought of it in those terms, having rarely used them - but does it cause the styling to change as well?

Thankfully not. The id is an attribute, and in this case it's the tag that assigns a style since I'm not using an attribute/value selector. So, thanks to that one-line comment I had the briefest and neatest solution handed to me: an internal link with no ugly side-effects.

My Post Script (not the one that caused the problem)

It has been troubling me for a while that I have used internal links in the past without this side-effect, that's why I was so surprised when it suddenly appeared. I can only assume that it was in the dim'n'distant days before CSS! I think that it was on an HTML4 based site, with less decorated features, but it's all changed now and I'm loathe to re-create it.

Hastings Pier.


Church Tower.

Last of the Summer (whine).

Along Came A Spider.

Among the Ruins.


Gone Fishin'.


The Harveys Brewery.

The Graingel.

Sunset on Trees.

Average Sized Redwood?

Dark skies.

Blog emerging @.

Valid XHTML 1.0 Transitional Valid CSS!