html - p:first child doesn't work if a img tag is immediately after the p tag? -
hy there, can't make work have this
.body-post p:first-child:first-letter { font-size:240%; }
and here html:
<div class="body-post"> <p><img src="http://#" align="left" style="margin-right:5px;"/> text</p></div>
so if theres no picture first letter works. there way skip img tag. cant edit source code because im doing template blogger domain. nothing serious, confusing. first letter should select letter not image.
after bit of research found out first-letter can used on block elements (which doing).
in solution increased selectivity of text wrapping in span , put in proper styling make span inline-block
<div> <p> <img src="http://placekitten.com/100/100"/> <span>kittens great</span> </p> </div> span:first-letter { font-size:2em; } span { display:inline-block; } img { margin-right:5px; }
Comments
Post a Comment