Trusted answers to developer questions

What is the content property in CSS?

Get Started With Data Science

Learn the fundamentals of Data Science with this free course. Future-proof your career by adding Data Science skills to your toolkit — or prepare to land a job in AI, Machine Learning, or Data Analysis.

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):

RELATED TAGS

property
content
css
html
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?