Using the Title Attribute With Anchor Tags

YouTubeI want to take a moment to talk to you about anchor titles. If you are like most people, you probably now have an image of an old-fashioned anchor from a Looney Tunes cartoon. But if you live in the world of computers, you know I am talking about website links. When a link is present in a document, it is done with an anchor (<a>) tag. This is, quite literally, what the web is built on. There would be no “web” without the anchor tag. So we really need to take it seriously.

But here’s the thing: no one likes a link to be a mystery. Before clicking, most people put their mouse over a link to see where it points to. There are lots of reasons for this. For me, avoiding direct links to The New York Times is important, because I only get ten articles per month. (I have a way of avoiding this, but it’s a bit of a pain.) But other reasons include just not being that interested or not trusting the writer to provide useful links. A lot of writers provide silly links — or jokes.

And speaking of jokes, Charlie Pierce provides “optional musical accompaniment” for a lot of his posts. That’s all well and fine, but I want to know what they are. In general, I’m not interested in listening to the song while reading his article; I just want to know what little joke he’s making. And this is in general the case with YouTube — which is notable because it is so common. Unless the writer is very explicit about the content of the video, it is an unwelcome mystery.

The issue came up today because I was editing an article about marketing. The writer had provided a YouTube link with the text, “For example, maybe your brand embodies attractive young people having fun.” What was the video about? It could have been a documentary about the media war between Coke and Pepsi. But it was instead just an old Coke commercial with “attractive young people having fan.” It wasn’t exactly necessary, given that we’ve all seen these kinds of commercials. But I was annoyed that I had to click over. I suspect most readers would have just skipped it.

As a writer or other content creator, it never hurts to assume that your visitors are working. They don’t want to spend a bunch of time figuring out why you linked to a particular thing. Blogs are usually good about this. For example, this page can be linked to like this: Using the Title Attribute With Anchor Tags. That link reads like this:

But it could also be linked like this: Using the Title Attribute With Anchor Tags. This is the actual URL — the one the system uses:

If a URL is relatively self-documenting, I don’t think link titles matter. But when they aren’t, they really do deserve a title. And it isn’t difficult to do. It is just a matter of adding title=”whatever” to your anchor tag. So, for example, a link to Frankly Curious would look like this:

<a href=”” title=”Greatest Website Ever!”>Frankly Curious</a>

And then the world will be a better place.

5 thoughts on “Using the Title Attribute With Anchor Tags

    • I should mark these ones as “for bloggers only.” If they are under “Computer/Meta” they can probably be passed up.

      That’s was great. It reminds me of That Mitchell and Webb Look’s Watch the Football!

      • That is is beautiful little trick! I’m going to have to save it on the desktop so I can refer to it a few times before I learn it by heart. I used it in a complaint about music, put in a hyperlink on the word “anesthetize,” linked it to “Radio Radio,” and now in preview mode if I cursor on the link it says “Elvis Costello, what else?”

        So if I write blog posts in the future I will try to limit my links to obvious source stuff (aka “you can read about it here”) but if I feel like adding a silly or sly link I will try to remember this trick.

        Teaching bloggers HTML, one step at a time. It’s great!

        • I’m thinking about creating a blog about blogging. There’s money in, I think. But I like writing about the technique of blogs. It is fascinating. And things like WordPress are incredibly complex.

Leave a Reply

Your email address will not be published. Required fields are marked *