View Full Version : little help styling anchor hover on anylinkcss?
daxtrajero
11-17-2011, 07:12 PM
I'm using the anylinkcss script here
http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm
I'm having trouble working out how to style the hover on the main anchor - mine is currently navy background when I hover over it, but I need to change it to grey
Any help would be appreciated.
This is what I'm trying, but failing with
.anchorclass {
background-colour:grey;
}
coothead
11-17-2011, 08:35 PM
Hi there daxtrajero,
I see two errors in the code, one fatal the other a possible problem in some browsers. :eek:
the English colour will not work in any browser. Use the American color.
the English grey may work in many browsers. It is safer to use the American gray.
coothead
daxtrajero
11-17-2011, 08:39 PM
Thanks will give it a try
daxtrajero
11-17-2011, 08:50 PM
still doesn't work - I can set the background-color on the link, but as soon as I hover over it (and the menu appears as it should) the link background-color changes and I can't see where I need to look to change it?
coothead
11-17-2011, 09:05 PM
Hi there daxtrajero,
if...
.anchorclass {
your attributes
}
...refers to the a elements, then use this for the hover state...
.anchorclass:hover {
background-color:gray;
}
If not give us a link to the site or the full code and we will look into your problem further. ;)
coothead
daxtrajero
11-17-2011, 09:08 PM
thanks, I'll give it a whirl.
I think there's something imposing itself on the css, after the anylinks section.
I've just tried the example code from the anylinkss page on dynamicdrive and I can happily change the background hover colour, so it's something wierd going on in my code.
Will look deeper.
daxtrajero
11-17-2011, 09:10 PM
coothead, I stand corrected. Just tried your code:
.anchorclass:hover {
background-color:gray;
}
instead of my rubbish code below....
.anchorclass a:hover {
background-color:gray;
}
and it works!
coothead
11-17-2011, 09:20 PM
No problem, you're very welcome. ;)
daxtrajero
11-18-2011, 03:32 PM
can someone tell me how I use this below? I've never seen two items together in inverted commas like this ?
class="anchorclass myownclass"
daxtrajero
11-18-2011, 03:45 PM
all sorted - found an error in my code - all sorted now
thanks everyone!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.