CSS :after selector
Complete CSS Selector Reference Manual
Example
Each
Insert content after an element:
p
:
after
{
content
:
"
- Remember this
"
;
}
Try it »
Definition and description
The :after selector inserts content after the last child of the selected element.
Usecontent property to specify the content to be inserted.
Browser support
The numbers in the table indicate the first browser version that supports this property.
| Selector | |||||
|---|---|---|---|---|---|
| ::after | 4.0 | 9.0 | |||
| Partially supported from 8.0 | 3.5 | 3.1 | 7.0 | ||
| Partially supported from 4.0 |
Note: For :after to work in IE8, a DOCTYPE must be declared. .
Related Articles
CSS Tutorial: CSS Pseudo-elements
CSS selector reference manual: CSS :before selector
More examples
Example
Insert content after each
Content and style inserted after:
p
:
after
{
content
:
"
- Remember this
"
;
background
color
:
yellow
;
color
:
red
;
font
weight
:
bold
;
}
Try it »