O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

content

Values:

normal | none | [ <string> | <uri> | <counter> | attr(<identifier>) | open-quote | close-quote | no-open-quote | no-close-quote ]+

Initial value:

normal

Applies to:

::before and ::after pseudo-elements

Inherited:

No

Computed value:

For <uri> values, an absolute URI; for attribute references, the resulting string; otherwise, same as declared value

Description:

Defines the generated content placed before or after an element. By default, this is likely to be inline content, but the type of box the content creates can be defined using the property display.

Examples:

p::before {content: "Paragraph...";}
a[href]::after {content: "(" attr(href) ")"; 
     font-size: smaller;}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required