What is the content property in CSS?

The content property in CSS is used to modify text inside an HTML tag. This property is combined with the ::after and ::before pseudo-elements that are used to append or prepend a value. This property can be set to the following common values:

1. Normal

This value applies the default value of this property, which is none:

2. Open-quote/close-quote

This value is used to add quotation marks before or after a text:

svg viewer

3. Value of attribute

The content can be set to the value of an attribute using the syntax attr(attribute-name):

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved