一、属性选择器:
1、对带有指定属性的HTML元素设置样式
2、属性和值选择器
<!DOCTYPE html>
<html lang="zh-cn">
<head>
???<meta charset="UTF-8">
???<title>Title</title>
???<style type="text/css">
???????[title]
???????{
???????????color:blue;
???????}
???????/*属性和值选择器*/
???????[title=te]{
???????????color: red;
???????}
???????
???</style>
</head>
<body>
<p title="t">属性选择器</p>
<p title="te">属性和值选择器</p>
</body>
</html>
CSS基础-属性选择器
原文地址:https://www.cnblogs.com/Lehh/p/8686317.html