04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Web page fit and finish<br />

Can you say “Web career?” You’ve certainly delivered everything the<br />

Starbuzz CEO has asked for, and you’ve now got a high profile Web site<br />

under your belt (and in your portfolio).<br />

But you’re not going to stop there. You want your Web sites to have that<br />

professional “fit and finish” that makes good sites into great ones. You’re<br />

going to see lots of ways to give your sites that extra “polish” in the rest of<br />

this book, but let’s start here <strong>with</strong> a way to improve your links.<br />

Improving accessibility by adding a title to your links<br />

Wouldn’t it be nice if there was a way to get more information about the link<br />

you’re about to click on? This is especially important for the visually impaired<br />

using screen readers because they often don’t want the entire URL spoken to<br />

them: (“h” “t” “t” p” “:” “slash” “slash” “w” “w” “w” “dot”) and yet the link’s<br />

label usually only gives a limited description, like “Caffeine Buzz”.<br />

The element has an attribute called title just for this purpose. Some<br />

people are confused by this attribute name because there’s an element called<br />

that goes in the . They have the same name because they<br />

are related – it is often suggested that the value of the title attribute be<br />

the same as value of the element of the Web page you are linking<br />

to. But that isn’t a requirement and often it makes more sense to provide your<br />

own, more relevant description in the title attribute.<br />

Here’s how you add a title attribute to the element:<br />

Read the Caffeine Buzz<br />

Exercise<br />

The title element has a value that is a textual<br />

description of the page you are linking to.<br />

getting connected<br />

Now that we’ve got a title attribute, let’s see how your visitors would make use<br />

of it. Different browsers make different use of the title, but many display a<br />

tool tip. Add the changes above to your “index.html” file and reload the page<br />

to see how it works in your browser.<br />

you are here 149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!