Forums

This topic is locked

Problems Using Multiple CSS

Posted 20 Jan 2005 17:20:33
1
has voted
20 Jan 2005 17:20:33 Christian Sen posted:
Hi there!

Got this problem with css that I can't figure out:

On my webpage I want to use one css-style in the heading (mouseover) and another
style in the main menu.

When I try to add the second css-style to the page it all blends into one style!

So my question would be this:
Does anybody know how I separate the two of them so that I can use two
different styles on one page?


Regards, Christian

Replies

Replied 20 Jan 2005 20:23:09
20 Jan 2005 20:23:09 Dave Thomas replied:
for your heading add :
<pre id=code><font face=courier size=2 id=code>
.heading a:link, .heading a:visited {
color: #666;
}
.heading a:hover{
color: #000;
}
</font id=code></pre id=code>

for your main menu add:
<pre id=code><font face=courier size=2 id=code>
.mainMenu a:link, .mainMenu a:visited {
color: #fff;
}
.mainMenu a:hover{
color: #999;
}
</font id=code></pre id=code>

then in dw, select your link and choose the 'heding' or ' mainMenu' style from the Styles drop down box.

the colours used are just an example, and you can also change font etc.. in the different style to make it look however you want.

regards
Dave

Edited by - UltraDav on 20 Jan 2005 20:24:19
Replied 20 Jan 2005 21:01:08
20 Jan 2005 21:01:08 Christian Sen replied:
What would I do without this forum?

Thank you Dave!
Replied 20 Jan 2005 21:06:09
20 Jan 2005 21:06:09 Chris Charlton replied:
The technique Dave is illustrating above is called <b>Descendant selectors</b>. Some good reading about them are www.westciv.com/style_master/academy/css_tutorial/selectors/descendant_selectors.html .

The W3C's official documentation about them: www.w3.org/TR/REC-CSS2/selector.html#descendant-selectors

Edited by - ccharlton on 20 Jan 2005 21:07:01
Replied 20 Jan 2005 21:27:51
20 Jan 2005 21:27:51 Christian Sen replied:
Thank you for the links, Chris!

I will check them out right away <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic