这是我的问题。
HTML
<div id="content">
<h1>Headline</h1>
<p>First paragraph that needs to be yellow.</p>
<p>Second paragraph that need not change. :) </p>
<p>Third paragraph that need not change. :) </p>
</div>
如果我使用#content p:first-child {color:yellow; }
,它不起作用,因为p
不是content
的第一个孩子... h1
是第一个孩子。如何在不触碰HTML代码的情况下完成这个操作?
谢谢!
最好的祝福, Cris