Sheepeth
(new user)
Sat Jun 16 2007 11:08 AM
StyleSheets

Having a problem with multiple stylesheets for a single html document.

I want to use more than one style for the page i'm creating.
I have links using the 'A:Link' - 'A:visited' style etc. But I want to have different styles for different links. I.E. Some links have a white background so the links need to be black on 'hover' and some links on the page have a dark bg so I need those to have a white 'hover'.

I originally created 2 different stylesheets for each type of link, but the latter of the css sheets overides the preceding one when linking externally.

I have tried using different classes and also embedding different styles within stylesheets themselves but nothing works.

How do you actually get stylesheets to work without conflicts?

An example of what i want is here http://www.dwp.gov.uk/ the links at the top are different styles
or maybe http://www.cps.gov.uk/


Sam
(regular)
Sat Jun 16 2007 08:03 PM
Re: StyleSheets

Have you tried...

a:hover {text-decoration: none; color: white;}
a.nav:hover {text-decoration: none; color: black;}

..and...

<a href="page1.html">White</a>
<a class="nav" href="page2.html">Black</a>

There's a full explanation here:

http://www.yourhtmlsource.com/stylesheets/csslinks.html


Contact Us | Privacy statement Main website
Hitwise Top 10 Award Winner - Jan-Mar 2005

About us | Contact us | Link to us | Terms & Conditions | Privacy Policy
© Copyright IPC Media Limited, All rights reserved