[TOC]
#### 子代選擇:
同級兄弟之間選擇:
正著選: div:nth-child(3)
反著選:div:nth-last-child(3)
~~~
<style>
div:nth-child(3){
color: red;
}
div:not(:last-child){
color: red;
}
</style>
</head>
<body>
<div class="parent">
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
</div>
</body>
~~~
x:nth-child(3){ }
x:相同的元素名稱
### 同級關系的選擇器
~~~
1. p:first-child{ }
2. p:last-child{}
3. .父類名>p:not(.子類的其中一個類名){}
列如:
<div class="parent">
<P>1</p>
<P class="two">1</p>
<P>1</p>
<P>1</p>
</div>
~~~