<!DOCTYPE html>标签:叠加,权重,color,li,ul,CSS From: https://blog.51cto.com/u_15732537/5806313
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS权重的叠加</title>
<style>
/* 复合选择器会有权重叠加的问题 */
/* 权重虽然会叠加,但是永远不会有进位 */
/* ul li 权重 0,0,0,1 + 0,0,0,1 = 0,0,0,2 2*/
ul li {
color: blue;
}
/* li权重 0,0,0,1 1*/
li {
color: green;
}
/* .nav li 权重 0,0,1,0 + 0,0,0,1 = 0,0,1,1 11*/
.test li {
color: pink;
}
</style>
</head>
<body>
<ul class="test">
<li>大猪蹄子</li>
<li>大肘子</li>
<li>猪尾巴</li>
</ul>
</body>
</html>