O'Reilly logo

CSS Mastery: Advanced Web Standards Solutions by Cameron Moll, Simon Collison, Andy Budd

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Styling Links

The humble anchor link is the foundation of the World Wide Web. It is the mechanism that allows web pages to interconnect and people to explore and navigate. The default styling for anchor links is fairly uninspiring, but with a little sprinkling of CSS you can do some amazing things.

In this chapter you will learn about

  • Ordering your link selectors based on the cascade

  • Creating stylized link underlines

  • Styling external links using attribute selectors

  • Making links behave like buttons

  • Creating visited-link styles

  • Creating pure CSS tooltips

Simple link styling

The easiest way to style a link is to use the anchor type selector. For instance, this rule will make all anchors red:

a {color: red;}

However, anchors can act as internal references ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required