I’m having trouble targetting just the first letter in this example here: http://jsfiddle.net/gB94x/
Obviously the “read more” isn’t supposed to have the drop cap too.
The HTML can’t be changed, it’s part of a fixed template.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.od_article>preferences allptags that are immediate children of.od_articleand therein lies your problem. You only want the firstptag. Change.od_article>p:first-letterto.od_article>p:first-of-type:first-letteras in the updated fiddle below.http://jsfiddle.net/gB94x/1/
UPDATE:
I don’t believe IE7 supports the
:first-of-typeunfortunately. I’m not sure if it supports:first-childeither but for reference,:first-childmatches if the element it’s applied to is the first child of its parent.I can’t think of a workaround off the top of my head but looking at the HTML the
pyou want to change the first letter for has the classCaptionPic1. If the first paragraph will always have this class, just use that, so.CaptionPic1:first-letter.