September 2014
Intermediate to advanced
148 pages
2h 15m
English
CHAPTER 5
![]()
Pseudo selectors
The pseudo-classes and pseudo-elements are keywords that can be appended to selectors to make them more specific. They are easy to recognize because they are always preceded by a colon.
Pseudo-elements
The pseudo-elements enable parts of an element to be styled. There are four of them in CSS, as discussed in the following sections.
first-letter and first-line
The pseudo-elements :first-letter and :first-line can apply styles to the first letter and the first line of an element. They work only on block elements such as paragraphs.
p:first-letter { font-size: 120%; }p:first-line { font-weight: bold; }
The preceding first ...
Read now
Unlock full access