<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
/*<!--行间优先级 权重值 1000-->*/
/*<!--id选择器权重 100-->*/
/*<!--类选择器权重 10-->*/
/*<!--标签选择器权重 1-->*/
/* 权重可以累加, 值越大,优先级越高 */
/*权重计算 10 + 1 = 11 */
.box span{
color: red;
}
/*权重计算 100 + 1 = 101*/
#box02 span{
color: blue;
}
</style>
</head>
<body>
<div class="box">
<div class="box02" id="box02" >
<!--行间优先级 权重值 1000-->
<span style="color: purple">
背影--朱志清
</span>
</div>
</div>
</body>
</html>
选择器优先级--进阶
最新推荐文章于 2021-06-05 23:24:48 发布