Pikk
Pikk

Reputation: 2743

How to apply first-child:first-letter to only one section?

please take a look here. I'd like to apply a different style to the first letters of all the blog posts that appear on the homepage.

I am trying with: p:first-child:first-letter { color: violet; font-size: 300%; }. It works almost fine. The problem is that it applies the style to ALL the <p> of the site.

I have also tried to apply a class to all the div containers, for example to class="entry_blog" and in CSS `p.entry_blog:first-child:first-letter', but these codes also don't work.

What am I doing wrong? How to apply the style to only the text inside <div class="entry_blog" itemprop="articleBody">?

Thanks

Upvotes: 0

Views: 71

Answers (2)

Jason
Jason

Reputation: 171

.entry_blog p:first-child:first-letter,{ color:violet; font-size:300%; }

Was going to say that :)

Upvotes: 1

phron
phron

Reputation: 1845

Try

.entry_blog p:first-child:first-letter{color: viloet; font-size:300%;}

which call every 'p' in div.entry_blog instead of p.entry_blog:first-child:first-letter which call every 'p' with a class of 'entry_blog'

Upvotes: 2

Related Questions