:首字母选择器不适用于链接 [英] :first-letter selector doesn't work for link
本文介绍了:首字母选择器不适用于链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
:first-letter
伪元素选择器可完美地用于<p>
元素,但不适用于链接.例如,这无效:
The :first-letter
pseudo-element selector works perfectly for a <p>
element but not for links. This, for instance, has no effect:
a:first-letter
{
font-size:200%;
text-transform:uppercase;
color:#8A2BE2;
}
为什么?如何使<a>
元素的首字母样式不同
Why? How can I make the first-letter style different for an <a>
element
推荐答案
According to the W3 spec, the :first-letter
pseudo-element only work for a block element, which a
is not.
奇怪的是,*:first-letter
使第一个字母转换为Chrome 14和Firefox 3.6.23.小提琴: http://jsfiddle.net/8W7FF/3/
Oddly, *:first-letter
caused the first letter to transform, at Chrome 14 and Firefox 3.6.23. Fiddle: http://jsfiddle.net/8W7FF/3/
这篇关于:首字母选择器不适用于链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文