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

Chapter 4. CSS Selectors > External Information: Pseudo-Classes and Pseudo-Elem...

External Information: Pseudo-Classes and Pseudo-Elements

In CSSI, style is normally based on the tags and attributes found in the HTML source. This works fine for many design scenarios, but it doesn’t cover some common design effects designers want to achieve.

Pseudo-classes and pseudo-elements were devised to fill in some of these gaps. Both are mechanisms that extend the expressive power of CSS. In CSSI, using pseudo-classes, you can change the style of a document’s links based on whether and when the links have been visited, or based on how the user interacts with the document. Using pseudo-elements, you can change the style of the first letter and first line of an element, or add elements that were not present in the source document. Neither pseudo-classes nor pseudo-elements exist in HTML; that is, they are not visible in the HTML code. Both mechanisms have been designed so that they can be further extended in future versions of CSS; i.e., fill in more gaps.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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