From spec :
After the rule p::before {content: "Note: "} selector p::first-letter matches the "N" of "Note" .
Note also that the display property is not valid on the :first-letter and :first-line pseudo elements. Again, from the spec:
A future version of this specification may allow this pseudo-element to be applied to other display types.
This is the intended behavior.
Workaround:
HTML:
<div><h1>Example title</h1></div>
and CSS:
h1{ display: inline-block; } h1::first-letter{ font-size: 0px; } div::before{ content: url(http://icons.iconarchive.com/icons/ariil/alphabet/32/Letter-E-icon.png); }
Demo: http://jsfiddle.net/kvaxmhth/3/
source share