如何跳过第一个孩子? [英] How to skip first child?
本文介绍了如何跳过第一个孩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<div id="main">
<p> one </p>
<p> two </p>
<p> three </p>
<p> four </p>
<p> five </p>
<div>
我不想将css应用于第一个< p& ; / p>
I don't want to apply css on first <p>One</p>
p {color:red}
我需要在的对面:first-child
。
推荐答案
使用否定伪类:
p:not(:first-child) { color: red; }
Browser support is very strong now, but alternatives include:
p { color: red; }
p:first-child { color: black; }
和:
* + p { color: red; }
这篇关于如何跳过第一个孩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文