CSS3中content的用法是什么
content 属性与 :before 及 :after 伪元素配合使用,来插入内容。
语法如下:
content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;
其中:
示例如下:
<html> <head> <meta charset="utf-8"> <title>123</title> <style> p:before { content:"好好学习,"; } </style> </head> <body> <p>天天向上</p> </body> </html>
输出结果: