<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>层叠性</title>
<style>
/*1*/
a {
color: red;
}
/*11*/
.head .nav .nav-home a {
color: blue;
}
.head a {
color: pink;
}
.nav a {
}
.nav-home a {
color: orange;
}
/*
观察,首先先看看当前元素有没有被选中, 如果未选中权重0,如果选中了就按权重计算,权重大的优先显示(要注意选择器的类型)
*/
</style>
</head>
<body>
<div class="head">
<div class="nav">
<div class="nav-home">
<a href="">首页</a>
</div>
<div class="nv-ele">
家电
</div>
</div>
</div>
</body>
</html>