We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,725 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

CSS menu hover question

Hi,

On my site ( http://www.js.excelitehost.com/ ) I just added a hover aspect to the menus so that when you hover the background changes.

Currently the only way that the hover effect will occur is if you place your mouse right on the link text.

What I'm wondering is: Is there a way with CSS to extend the hover switch out to the right so that if you hover anywhere on the "button" it will change.

Here is an example of the first link:

<div id="navbutton"><a href="index.html" >Home</a></div>

And here is the CSS governing them:

#navbutton {
	margin-left: 4px;
	margin-right: 4px;
	border-bottom: 1px dashed #FFF8DC;
	background: #e6e5c9;
}

#navbutton :hover {
	
	display: block;
	background: #F5F5DC;

}

Thanks,
John

2
Contributors
3
Replies
20 Hours
Discussion Span
8 Years Ago
Last Updated
4
Views
John P
Light Poster
30 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

try display: block on your #navbutton and #navbutton a
You may need to alter your other code to regulate the width it extends to.

DaveSW
Master Poster
769 posts since Jul 2004
Reputation Points: 54
Solved Threads: 20
Skill Endorsements: 0

Excellent, Thank you!
That did it.

Thanks,
John

John P
Light Poster
30 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

cool. Glad to help.

DaveSW
Master Poster
769 posts since Jul 2004
Reputation Points: 54
Solved Threads: 20
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0685 seconds using 2.69MB