Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS :after selector

CSS :after selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Each

Insert content after an element:

p

:

after

{

content

:

"

"

;

}

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

:

"

"

;

background

color

:

yellow

;

color

:

red

;

font

weight

:

bold

;

}

Try it »