Jump to content

CSS pains


G1337

Recommended Posts

I'm having some trouble making a CSS drop down menu, wondering if any help can be offered, here's the code, tell me if you see a problem.

<html><heaD><title>Drop down menu?</title><style type="text/CSS">a { text-decoration: none; }ul.menu, ul.menu, ul {width: 60px;border: 2.5px double blue;background-color: black;margin-left: 5px;}ul.menu li {list-style-type: none;margin: 0;position: relative;color: red;}ul.menu li > ul {display: none;position: absolute;top: 3px;left: 50px;}ul.menu ul.CSStoShow {display: none;}ul.menu li:hover > ul {display: block;}ul.menu li a { color: red; display: block; width: 100% text-decoration: none; }ul.menu li a:hover, ul.menu li a.CSStoHighLink { color: blue; }ul.menu li:hover > a {color: blue; }</style></head><body><ul class="menu"><li>Menu</li><ul><li><a href="http://Google.com">Sub</a></li><li>Menu</li><li>Here</li></ul></ul></li>

This one's getting to me. :)

Link to comment
Share on other sites

Hey,Do you have to do this in the CSS code because i can help you with the same effect, but using JavaScript to activate the hide/show of the second menu.DiNo

Link to comment
Share on other sites

Guest mvnbh

In javascript you can do it very easily.1) Add this part in the scriptfunction show(varname){ if (varname == 1) { document.getElementById('divlayer').style.display=''; document.getElementById('divlayer').style.visibility = 'visible'; }}in your 2nddrop downadd < ...... id='divlayer' style="display: none; visibility: hidden">in your firstdropdown add <..... onmouseover="java script: show('divlayer')"...>- What this does is initially sets the 2nddropdown value as hidden and mouseover the firstone the second one is active. Hope this helps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...