CSS content Property

In CSS, the content property is used to generate content dynamically (during runtime), i.e., it replaces the element with the generated content value. It is used to generate the pseudo-elements content::before and content::after.




Property Values

Value Description
normal The default value. Sets the content to normal, if specified; the default is "none".
none If the content is specified, it is set to nothing.
counter The content is set as a counter.
attr(attribute) Sets the content as an attribute of the selector.
string Sets the content to the specified text.
open-quote The content is set to be an opening quote.
close-quote The content is set to be a closing quote.
no-open-quote If specified, remove the opening quote from the content.
no-close-quote If specified, remove the closing quote from the content.
url Sets the content to be a type of media (an image, a sound, a video, etc.).
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
content 1.0 1.0 1.0 8.0 4.0