css nth_child,nth_of_type

nth-child() 选择器

规定属于其父元素的第二个子元素的每个 p 的背景色:

p:nth-child(2)
{
background:#ff0000;
}
posted @ 2018-03-02 09:54  宁静花园  阅读(94)  评论(0编辑  收藏  举报