04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

how to style links<br />

The element and its multiple personalities<br />

Have you noticed that links act a little differently when it comes<br />

to style? Links are chameleons of the element world because,<br />

depending on the circumstance, they can change their style at a<br />

moment’s notice. Let’s take a closer look:<br />

Here’s a link you’ve never clicked on<br />

before. This is called an “unvisited link”,<br />

or just ‘link”, and it’s blue by default.<br />

And here’s a link you<br />

have clicked on before.<br />

We call these “visited<br />

links”. Usually, visited<br />

links are displayed<br />

in a different color<br />

than unvisited links so<br />

that you can tell the<br />

difference. In most<br />

browsers, visited links<br />

are purple by default.<br />

468 Chapter 11<br />

And if you hold your mouse over a link <strong>with</strong>out<br />

clicking, this is called “hovering”. On some<br />

browsers you’ll see a tool tip that displays the<br />

text of the “title” attribute. And, if you pay<br />

close attention, on some Web pages, you’ll see a<br />

different style as you hover.<br />

Unlike other elements, the style of an element changes depending<br />

on its state. If the link has never been clicked on, it has one style, and<br />

if it has been clicked on, another. And if you hover over a link, it can<br />

have yet another style. Perhaps there’s more to styling elements<br />

than meets the eye? You betcha... let’s take a look.

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

Saved successfully!

Ooh no, something went wrong!