<title>css伪类选择器</title>
<style type="text/css">
p{
color: brown;
border: 1px solid black;
height: 40px;
line-height: 40px;
}
p::before{
content: "before开始";
}
p::after{
content: "after结束";
}
/* 针对块元素
第一个字母::first-letter
第一行文字::first-line */
div::first-letter{
font-size: 24px;
color: blue;
}
div::first-line{
color: yellowgreen;
font-style: initial;
font-weight:bolder;
}
</style>
</head>
<body>
<div class="box">http://www.dhnblog.com/ 大灰牛博客技术为王世界,拼搏成就梦想,高度取决态度
<!--before 开始-->
<p>情人节祝福语送女朋友,很甜很撩,瞬间收服她的心!</p>
<!--after 结束-->
</div>
</body>
</html>
总结
以上所述是小编给大家介绍的css选择器四大类:基本、组合、属性、伪类,希望对大家有所帮助,也非常感谢大家对软件开发网网站的支持!










