可继承的样式: font-size ,font-family ,color, background等;
不可继承的样式:border, padding ,margin ,width ,height
优先级就近原则,同权重情况下以最近者为准;
优先级为: !important > 内联>id > class > tag
important 比 内联优先级高
CSS3 新增伪类:
:first-child 选择属于其父元素的首个元素。
:last-child 选择属于其父元素的最后一个元素。
:only-child 选择属于其父元素唯一的元素。
:nth-child(n) 选择属于其父元素的任意一个子元素。
:empty 选择没有子元素的元素。
:not(selector) 将满足指定选择器的元素给排除在外