Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2010, 01:35 PM   PM User | #1
kickthat
New Coder

 
Join Date: Oct 2010
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
kickthat is an unknown quantity at this point
CSS DropDown

Hi

I have used a CSS drop down menu to work providing information on my site.

To make this clearer. When you hover over a name, it provides details about that person in the drop down menu.

However, as this is tabled with one persons name under the next, I want the drop down to ONLY show up when you hover over the headlink. Meaning that when you lower the mouse onto the drop down list, it disappears.

Can this be done and can anyone help with the code?

The current code for my drop down is as follows

Code:
/* General */
	#rankingsdropdown, #rankingsdropdown ul { list-style: none;}
	#rankingsdropdown, #rankingsdropdown * { padding: 0; margin: 0; }
	
	/* Head links */
	#rankingsdropdown li.headlink { width: 137px; float: left; margin-left: -1px; text-align: center; }
	#rankingsdropdown li.headlink a { padding: 15px; }
 
	/* Child lists and links */
	#rankingsdropdown li.headlink ul { position:absolute; display: none; width: 137px; border: 1px black solid; background-color: white; text-align: left; }
	#rankingsdropdown li.headlink:hover ul {display:block}
	#rankingsdropdown li.headlink ul li a { padding: 5px; }
	#rankingsdropdown li.headlink ul li a:hover { background-color: #333; }
	
	/* Pretty styling */
	body { font-family: verdana, arial, sans-serif; font-size: 0.8em; background-color: black; }
	#rankingsdropdown a { color: white; } 
	#rankingsdropdown ul li a:hover { text-decoration: none; }
	#rankingsdropdown li.headlink { background-color: white; background: white; margin-left:auto; margin-right:auto }
	#rankingsdropdown li.headlink ul { background-position: bottom; padding-bottom: 10px; }
Thanks!

Last edited by kickthat; 10-20-2010 at 02:30 PM..
kickthat is offline   Reply With Quote
Old 10-20-2010, 01:40 PM   PM User | #2
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Something like:

Code:
#rankingsdropdown li.headlink ul:hover {display:none}
should do it.
SB65 is offline   Reply With Quote
Old 10-20-2010, 01:48 PM   PM User | #3
kickthat
New Coder

 
Join Date: Oct 2010
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
kickthat is an unknown quantity at this point
Thanks for the reply. It doesn't seem to be doing the trick. I might not be doing it right. Are you suggesting that I simply add it to the code, if so, where?

Or are you suggesting that I should be replacing one of the existing lines of code with that?

Thanks
kickthat is offline   Reply With Quote
Old 10-20-2010, 01:50 PM   PM User | #4
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
No, that's an additional line of css. I'm assuming that the .headlink is the menu item we're talking about. If that doesn't work, can you give a link to your page - otherwise I'm just guessing at your html?
SB65 is offline   Reply With Quote
Old 10-20-2010, 01:56 PM   PM User | #5
kickthat
New Coder

 
Join Date: Oct 2010
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
kickthat is an unknown quantity at this point
The page is at:
http://www.keelefoos.co.uk/national_rankings.htm

That's without the line added.
kickthat is offline   Reply With Quote
Old 10-20-2010, 02:01 PM   PM User | #6
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
The line should be in the css, under the display:block line:

Code:
    #rankingsdropdown li.headlink:hover ul {display:block}
        #rankingsdropdown li.headlink ul:hover {display:none}
Give that a try.
SB65 is offline   Reply With Quote
Users who have thanked SB65 for this post:
kickthat (10-20-2010)
Old 10-20-2010, 02:04 PM   PM User | #7
kickthat
New Coder

 
Join Date: Oct 2010
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
kickthat is an unknown quantity at this point
No go. Still not working.
kickthat is offline   Reply With Quote
Old 10-20-2010, 02:06 PM   PM User | #8
kickthat
New Coder

 
Join Date: Oct 2010
Posts: 21
Thanks: 3
Thanked 0 Times in 0 Posts
kickthat is an unknown quantity at this point
Got it.
Changed the {display:none} in the line of code you suggested to {visibility:hidden} seems to have done the trick.
kickthat is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting 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

Forum Jump


All times are GMT +1. The time now is 10:48 AM.


Advertisement
Log in to turn off these ads.