Learn to code
Getting to Know CSS
- 選擇器的的權(quán)重比位置更重要
type類型的權(quán)重是0-0-1赢乓,class的是0-1-0找蜜,id的是1-0-0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="hotdog">
<p>Yes</p>
<p>Yes</p>
<p class="mustard">Yes</p>
</div>
</body>
</html>
.hotdog p.mustard {
background: yellow;
}
.hotdog p{
background: brown;
}