|
|
Changing b/ground colour on rollover?
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: UK
Status:
Offline
|
|
Hi
I'm trying to get the background of a menu item to change colour as the rollover state. Something simple, like the left menu items on this page.
I have limited experience and I'm using Dreamweaver, so I usually insert a div tag, plonk the contents in it then create a style for it. I've tried styling a:hover, but I don't think this is the way to do it.
This seems like a basic task but I can't find any tutorials - not any I understand, anyhow.
Any advice?
Thanks
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
a:hover is correct, assuming you'll have links inside that div
If you're not bothered about Win/IE support, then you could use myelement: hover where myelement is the selector for the div you want. Give the div a class or an id or select it however you like.
If you are looking for Win/IE support, then you could use links, as Win/IE only supports the hover pseudoclass on links, rather than on any arbitrary element, like it should. Either that, or get funky with some JavaScript...
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: UK
Status:
Offline
|
|
Thanks for that.
I guess the reason I wasn't so keen on the hover/text link method was a) because I'd prefer a margin around the text, like the example I linked to (rather than the area right up to the edge of the text being the only background) and b) I think link text looks a little ugly. But I've realised I don't have to have the usual blue/underlined links (using a style), so this could be the solution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|