Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Changing b/ground colour on rollover?

Changing b/ground colour on rollover?
Thread Tools
drissa
Dedicated MacNNer
Join Date: Dec 2002
Location: UK
Status: Offline
Reply With Quote
Jan 19, 2005, 08:22 PM
 
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
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Jan 20, 2005, 06:27 AM
 
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
     
drissa  (op)
Dedicated MacNNer
Join Date: Dec 2002
Location: UK
Status: Offline
Reply With Quote
Jan 20, 2005, 01:49 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:36 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,