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

Chapter 10. Style Sheet Attribute Refere... > Pseudo-Elements and Pseudo-Classes

10.2. Pseudo-Elements and Pseudo-Classes

Most style sheet rules are associated with distinct HTML elements or groups of elements identified via style sheet selectors, such as classes, IDs, and contextual selectors (see Chapter 3). In rare instances, you might want to assign a style to a well-defined component of an element or to all elements that exhibit a particular state. CSS2 recommends that browsers expose the first letter and first line of a paragraph so that a style sheet rule can focus only on that portion of the element. For example, by careful application of attributes, you can create a drop cap initial letter for a paragraph with the following definition:

P:first-letter {font-size: 36pt; font-weight: 600; 
                font-family: Rune serif; float: left}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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