如何选择多个段落标签中的n + 4个跨度标签。例如,我可能有4个段落,这些句子的句子都包裹在标签中,而我只想显示4个段落中范围的前三个标签,因此每个段落可能每个都有两个句子,我需要隐藏其余的范围标签从第二段的第四句开始。目前,它仅从段落中选择,而不仅是其自身的跨度https://www.example.com
<div>
<p>
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</span><span> Aliquid sapiente possimus voluptas ad nostrum similique, dolor, vero, culpa eum tenetur ullam amet at sequi.</span>
</p>
<p>
<span>Modi quidem culpa, cum alias rem.</span><span>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</span><span> Aliquid sapiente possimus voluptas ad nostrum similique, dolor, vero, culpa eum tenetur ullam amet at sequi.</span>
</p>
<p>
<span>Modi quidem culpa, cum alias rem.</span>
</p>
<p>
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</span><span> Aliquid sapiente possimus voluptas ad nostrum similique, dolor, vero, culpa eum tenetur ullam amet at sequi.</span> <span>Modi quidem culpa, cum alias rem.</span><span>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</span><span> Aliquid sapiente possimus voluptas ad nostrum similique, dolor, vero, culpa eum tenetur ullam amet at sequi.</span> <span>Modi quidem culpa, cum alias rem.</span>
</p>
</div>
div {
span:nth-child(n + 4) {
display: none;
}
}