This page is Ready to Use

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.



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

CSS 2.1
W3C Recommendation
Selectors Level 3
W3C Recommendation

See also

Related pages