<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style type="text/css"> /*selector1:not(selector2)符合selector1,不符合selector2*/ div:not(.diaosi) { height: 30px;/*pixel picture element*/ background-color: blueviolet; } /*selector:target匹配符合selector,并且必须是命名锚点目标的元素*/ a:target { background-color: cornflowerblue; } </style> </head> <body> <div class="diaosi">我叫李瑞琦</div> <div>我叫汪峰</div> <hr/> <a name="cba">cba</a> <a name="abc">abc</a> <a href="#abc">点击</a> </body> </html>
CSS3 target伪类和not伪类.html
最新推荐文章于 2024-08-03 09:00:00 发布