实例
规定属于其父元素的第二个子元素的每个 p 的背景色:
p:nth-child(2) { background:#ff0000; }
第二个样例
.pro2 li:nth-child(4) {
margin-right: 0}
pro2下的第4个li的样式