Jump to: navigation, search


This article is Ready to Use.

W3C Recommendation


Inserts content after the selected element(s).

The ::before and ::after pseudo-elements specify the location of content before and after an element in the document tree. The content attribute, in conjunction with these pseudo-elements, specifies what is inserted. The generated content interacts with other boxes as if they were real elements inserted just inside their associated element. The content box of the associated element expands to include the generated content, if necessary.


sel ::after


A simple selector



span::after { 
  content: " Required";


Web authors are encouraged to use the two-colon form of the ::after pseudo-element.

Related specifications

Specification Status Related Changes
CSS 2.1 W3C Recommendation
Selectors Level 3 W3C Recommendation



Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?


Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

Compatibility notes

Browser Version Note
Internet Explorer 8+ In Windows Internet Explorer 8, as well as later versions of Windows Internet Explorer in IE8 Standards mode, only the one-colon form of this pseudo-element is recognized—that is, :after. Beginning with Windows Internet Explorer 9, the ::after pseudo-element requires two colons, though the one-colon form is still recognized and behaves identically to the two-colon form.

See also

Related pages


This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]