1.>父子选择器
#content>header {
height: 50px;
background-color: darkgoldenrod
}
选中#content下所有的a标签:多代的 空格
子代选择器
设置字体大小 font-size
#content a {
color: black;
font-size: 20px;
}
选中brother的兄弟strong
兄弟选择器
.brother~strong {
color: brown;
font-weight: bolder;
}
选中div的相邻兄弟section
相邻选择器
<div id="content">
<header>
<nav>
<a href="#">百度</a>
<a href="#">淘宝</a>
<a href="#">京东</a>
<span class="brother">大哥</span>
<span>老大</span>
<strong>老二</strong>
</nav>
</header>
<main>
<div>我是内容</div>
<section>我是内容</section>
</main>
</div>