Reputation: 25
I'm trying to apply a certain style to the first letter in my header, which is made up of text. My webpage is here: http://smarterinfive.com
It works well in Chrome, but not at all in FF. Here are properties I already tried applying my styles to, with no avail (in FF):
header[role="banner"] .branding:first-letter {
background: #000;
}
.branding:first-child:first-letter {
background: #000;
}
.branding h1 a:first-child:first-letter {
background: #000;
}
It seems that anything with first-letter
or first-child:first-letter
isn't working, but everything with first-child
only IS.
I also tried:
!important
at the end of these.Upvotes: 0
Views: 1067
Reputation: 40473
The problem for .branding h1 a:first-child:first-letter
is that first-letter
can only be applied to block elements, not inline elements like a
. See this previous question
I also don't understand why the others aren't working...
But why do you need to even use first-child
?
You can get the same effect and solve the problem with this:
.branding h1:first-letter {
background: black;
}
It's actually more simple.
Upvotes: 2