- Home
- /
- Tutorials
- /
- CSS Tutorial
- /
- CSS Pseudo Elements
CSS Selectors
CSS Pseudo Elements
CSS Pseudo Elements are used to style specific parts of an HTML element.
Unlike pseudo classes, which target an element's state, pseudo elements target a particular portion of an element's content. The supporting concepts are explained in CSS Pseudo Classes and Generated Content.
Pseudo elements begin with a double colon (::) and allow you to:
- Style the first letter
- Style the first line
- Insert content before or after an element
- Customize selected text
Common pseudo elements include:
- ::before
- ::after
- ::first-letter
- ::first-line
- ::selection
Syntax
CSS Pseudo Elements Syntax
css
