Reputation: 55
Hi I try to edit the css of wordpress themes but I get stuck when I saw this DIV Style.
<li id="text-3" class="widget sbg_widget Phubadee widget_text">
<h2 class="widgettitle sbg_title">Title Header</h2>
How Can I make the CSS When I want the : Title Header : font-size: 1.6em;
Thank you so much.
Upvotes: 0
Views: 104
Reputation: 1303
There is more way to do that.If you want you can add this to you css
h2.widgettitle {font-size:1.6em;}
or if you want to be more specific
h2.widgettitle .sbg_tittle
Upvotes: 2
Reputation: 5511
There are alot of way you can do it. Any of these will work, and there are more ways to do it!
li.widget h2 { font-size:1.6em }
li.sbg_widget h2 { font-size:1.6em }
h2 { font-size:1.6em }
h2.widgettitle { font-size:1.6em }
h2.sbg_title { font-size:1.6em }
.widgettitle { font-size:1.6em }
.sbg_title { font-size:1.6em }
li h2 { font-size:1.6em }
li>h2 { font-size:1.6em }
li#text-3 h2 { font-size:1.6em }
li#text-3 h2.widgettitle { font-size:1.6em }
li#text-3 h2.sbg_title { font-size:1.6em }
If you want to learn about CSS selectors, Sitepoint has a good breakdown of what they are and how they work
Upvotes: 2
Reputation: 801
Option 1:
.widgettitle.sbg_title {font-size:1.6em;}
Option 2:
.sbg_title {font-size:1.6em;}
Option 3:
.widgettitle {font-size:1.6em;}
Upvotes: 0
Reputation: 9644
You can select that item in many ways, try for example
li#text-3 h2.sbg_title {
font-size: 1.6em;
}
Upvotes: 0
Reputation: 60506
h2.widgettitle.sbg_title { font-size:1.6em }
Explanation:
.
is a class selector in css, your h2
has class widgettitle
and sbg_title
, so we would like to select those two by using .
.
Note that there can't be any space between widgettitle
and the next .
, having space means entirely different thing, which is selecting any descendant of widgettitle
that has class sbg_title
Upvotes: 2