【发布时间】:2011-10-03 01:17:48
【问题描述】:
如何定位标题后面的所有 p 元素,例如....
<h2 class = 'history'>History</h2>
<p>this is paragraph 1</p>
<p>this is paragraph 2</p>
<p>this is paragraph 3</p>
<h2 class = 'present'>Present</h2>
<p>I don't want to target this paragraph</p>
<p>I don't want to target this paragraph</p>
<p>I don't want to target this paragraph</p>
通过使用 .history + p 我可以定位第 1 段,但如何定位其他段落直到我到达“当前”H2 标记?
【问题讨论】:
标签: html css css-selectors