属性选择器
书写格式: 属性title的p元素:p+[title]
属性以ab开头的:p[title^="ab"]
属性以c结尾的:p[title$="c"]
属性包含c的:p[title*="c"]
子元素选择器
书写格式:第一个孩子:p:first-child{}
第一个直接的孩子:body>p:first-child{}
最后一个孩子:p:last-child{}
指定要选中第几个子元素(自定义第几个孩子): p:nth-child(数字){}
奇数 : p:nth-child(odd){}
偶数 : p:nth-child(even){}
看类型(只要是p元素里的老大)p : first-of-type{}
兄弟选择器
书写格式:span+p{}---- ‘ + ’ 表示紧挨着的span的兄弟
span~p{}---- ‘ ~ ’ 后边所有的兄弟