In CSS3, the content attribute is used in conjunction with the ":before" and ":after" pseudo-elements to insert content before and after the element. The syntax is "element:before{content:"inserted content" ;}" and "Element:after{content:"Inserted content";}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
What is the usage of content in css3
The content attribute is used in conjunction with the :before and :after pseudo-elements to insert content.
The syntax is as follows:
content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;
Among them:
<html> <head> <meta charset="utf-8"> <title>123</title> <style> p:before { content:"好好学习,"; } </style> </head> <body> <p>天天向上</p> </body> </html>
css video tutorial)
The above is the detailed content of What is the usage of content in css3. For more information, please follow other related articles on the PHP Chinese website!