1.含有herf属性的
2.属性值含有“1”的
3.属性值以“p”开头的
4.属性值以“1” 结尾的
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>属性选择器1210</title>
<style type="text/css">
[href]{
color: red;
}
[class*='1']{
color: red;
}
[class^="p"]{
color: green;
}
[class$="1"]{
color: deeppink;
}
</style>
</head>
<body>
<a href="" title="我是a" class="a1">我是a1标签</a>
<a href="" class="pa">我是a2标签</a>
<p class="p1">我是p标签</p>
</body>
</html>
效果如下: