Results 1 to 3 of 3

Thread: dropdown menu

  1. #1
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dropdown menu

    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.
    Code:
    <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>

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You don't have a doctype, add this to your page, before the <html> tag:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Happy coding!

  3. #3
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Snookerman View Post
    You don't have a doctype, add this to your page, before the <html> tag:
    HTML Code:
    <!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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •