【发布时间】:2011-11-27 11:11:41
【问题描述】:
在练习 CSS3 伪类和选择器可能派上用场的不同场景时,我遇到了一些我无法弄清楚的事情!
情况是这样的。我想为一段文本修改第一个非空段落的:first-of-type::first-letter。我不确定伪类是否可以堆叠。这是我想出的(当然不行)
.article-body > p:not(:empty):first-of-type::first-letter { ... }
给定以下标记:
<div class="article-body">
<p></p>
<p>The "T" in this paragraph should be the one affected.</p>
</div>
我能想到的唯一猜测是伪类(即:not() 和 :first-of-type)不能相互堆叠。这很奇怪,因为您可以将伪元素和其他伪类堆叠在一起......
关于如何实现这一点的任何想法?
【问题讨论】:
标签: css-selectors css