Log in

View Full Version : dropdown menu



hkp
05-22-2009, 07:23 AM
hello friends, I have design a dropdown menu only using css. But My problem is that It is working fine in the firefox but not in the internet explorer.
Here is the code of that drop down menu.


<html>
<head>
<style type="text/css">
ul {
margin: 0;
padding: 0;
list-style: none;

}
ul li {

position: relative;

float: left;
width: 100px;

}
li ul {
position: absolute;
top: 30px;
display: none;
}
ul li a {
display: block;
text-decoration: none;
line-height: 20px;
color: #000;
padding: 5px;
background: #CC0;
margin: 0 2px;
}

ul li a:hover { background: #66F; }
li:hover ul, li.over ul { display: block; }
</style>
<body>
<ul id="nav">
<li><a href="">Home</a></li>
<li><a href="">Web</a>
<ul>
<li><a href="">Browser</a></li>
<li><a href="">Search</a></li>
</ul>
</li>
<li><a href="">Monkey</a>
<ul>
<li><a href="">Eating Banana</a></li>
<li><a href="">Throwing Poop</a></li>
</ul>
</li>
<li><a href="">Contact</a>
<ul>
<li><a href="">Via Web</a></li>
<li><a href="">Via Phone</a></li>
<li><a href="">Via tin can and string</a></li>
</ul>
</li>

</ul>

</body>
</html>

Snookerman
05-22-2009, 07:49 AM
You don't have a doctype, add this to your page, before the <html> tag:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Happy coding!

hkp
05-28-2009, 07:09 AM
You don't have a doctype, add this to your page, before the <html> tag:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Happy coding!

But is doesn't effect the result of the web page. It is not good reply by you.