Reputation: 63
Specifically this:
p:first-child:first-letter {font-size:48px;}
Works in all browsers (even IE8 for crying out loud) but not Firefox (v.10.02)
Anybody know a CSS or javascript work-around? The only thing I can think of doing to achieve what I want (a drop cap in the first paragraph) is to dynamically wrap that first character with span tags. But surely there's a better way?
Upvotes: 0
Views: 456
Reputation: 18042
you could do:
p:first-letter {font-size:48px;}
p + p:first-letter {font-size:1rem}
that uses the new rem
unit, which is root em, for IE>8 you would have to put in your root font size manually.
or you can use JQuery like
$('p:first-child').addClass('first-child');
and change your css to
p.first-child:first-letter { font-size:48px}
Upvotes: 1
Reputation: 10786
I think p doesn't have any children. try with:
p:first-letter{font-size:48px;}
Upvotes: 0