css3中content的用法是什么
时间:2022-02-11 17:24
在css3中,content属性与“:before”及“:after”伪元素配合使用,用于在元素的前后插入内容,语法为“元素:before{content:"插入的内容";}”和“元素:after{content:"插入的内容";}”。 本教程操作环境:windows10系统、CSS3&&HTML5版、Dell G3电脑。 css3中content的用法是什么 content 属性与 :before 及 :after 伪元素配合使用,来插入内容。 语法如下: 其中: 示例如下: 输出结果: (学习视频分享:css视频教程) 以上就是css3中content的用法是什么的详细内容,更多请关注gxlsystem.com其它相关文章!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>