• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter Ten. CSS in Action: A Hybrid Lay... > Coloring the Links (Introducing Pseu...

Coloring the Links (Introducing Pseudo-Classes)

In presentational HTML, we controlled link colors via attributes to the body element such as vlink="#CC3300". In modern web design, we can leave our body naked and unadorned and use CSS instead. To sweeten the deal, CSS adds a “hover” state to the familiar link, visited, and active states we learned to love in the 1990s. CSS also allows us to do more than merely change link colors.

CSS calls these anchor (link) states pseudo-class selectors. In the CSS way of thinking, a “real” class is one that you specify explicitly with a class= attribute. A pseudo-class is one that depends on user activity or browser state (:hover, :visited). There are also pseudo-elements (:before and :after). In any case, with the four rules that follow, we control link colors and more [10.4, 10.5].


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint