css3中content的用法是什么

CSS3中content的用法是什么

content 属性与 :before 及 :after 伪元素配合使用,来插入内容。

语法如下:

content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;

其中:

6dd70385fa8d3cb2e5f9b9fb75f105b8

示例如下:

<html>
<head>
<meta charset="utf-8">
<title>123</title>
<style>
p:before { 
  content:"好好学习,";
}
</style>
</head>
<body>
<p>天天向上</p>
</body>
</html>

输出结果:

19b3dcb845d99e2f237304b43e6d50be

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容