派生选择器
通过依据元素在其位置的上下文关系来定义样式
index.html1
2
3
4
5
6
7
8
9
10
11
12
13
14
15<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="demo.css" type="text/css" ref="stylesheet">
</head>
<body>
<!-- blue -->
<p><strong>Hello JhonRain</strong></p>
<ul>
<!-- red -->
<li><strong>li标签:Hello Css</strong></li>
</ul>
</body>
</html>
demo.css1
2
3
4
5
6li strong{
color:red;
}
strong{
color:blue;
}
最后更新: 2018年09月26日 12:01