CSS :afterSelectors
Complete CSS Selector Reference Manual
Example
Insert content after each `<p>` element:
p:after
{
content:"- Remember this";
}
Try it Yourself »
Definitions and explanations.
The :after selector inserts content after the last child element of the selected element.
Usagecontentattribute to specify the content to be inserted.
Browser Support
The numbers in the table specify the first browser version that supports the property.
| Selectors | |||||
|---|---|---|---|---|---|
| ::after | 4.0 | 9.0 Partial from 8.0 |
3.5 | 3.1 | 7.0 Partial from 4.0 |
Note:For `after` to work in IE8, you must declare<!DOCTYPE> .
Related Articles
CSS Tutorial:CSS Pseudo-elements
CSS Selectors Reference:CSS :before Selector
More Examples
Example
The content and style inserted after each <p>:
p:after
{
content:"- Remember this";
background-color:yellow;
color:red;
font-weight:bold;
}
Try it Yourself »