Forum Moderators: not2easy

Message Too Old, No Replies

Changing H3 inside different DIVs

New colour depending on DIV

         

bateman_ap

3:26 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, prob a simple question but I am trying to get H3 tags to style slightly different depending on what DIV they are in. ie I have set up a master H3 style for all H3s to follow and I just want to change their colour depending on the div they are in. ie

h3 {
margin: 7px 0px 4px;
font-size: 14px;
text-transform: uppercase;
}

The code might read
<div class="redbox">
<h3>H3 Heading</h3>
......
</div>

I have tried using the following in my code but no luck

#redbox h3 {
color: #FBCAA2;
}

Many thanks

benihana

3:34 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



#redbox would be for id="redbox"

try:

.redbox {
...
}

instead.

Ben

RJell

3:36 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



Well, since you're using "redbox" as a class in your html, you should declare it as a class in your CSS (which would imply that you were going to use it more than once in a page).

Try this instead:


.redbox h3 {
margin: 7px 0px 4px;
font-size: 14px;
text-transform: uppercase;
}

bateman_ap

3:52 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many thanks. Had forgot to say I had already got code for redbox but using

.redbox h3 {
color: #FBCAA2;
}

worked perfectly.