标签:
CSS content 属性常结合:before 和:after 这两个伪类一起使用,给指定的元素添加内容来丰富页面。
1. 添加文本内容
html:
<h1>给末尾添加内容。 </h1> <h2>给末尾不添加内容。 </h2>
css:
<style>
h1:after{
content: “hello world!!”
}
h2:after{
content: none
}
</style>
所要添加的内容用双引号引起来,若不添加内容可使用 属性none
标签:
原文地址:http://www.cnblogs.com/olive987/p/5797198.html