SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drop Down Menu not working in IE

    Hi, I face problem having my drop down menu to only work in other browsers except for IE. Anyone knows what should I do to the codes below to solve the problem?

    <style type="text/css" align="center">
    <!--

    #navbar2 {
    margin: 0;
    padding: 0;
    height: 27;
    text-align: center;
    width: 1200;
    background-color: #FC8;
    }

    #navbar2 li {
    list-style: none;
    float: left;
    display: inline;
    width: 10em;
    text-align: center;
    }

    #navbar2 li a {
    display: block;
    padding: 3px 8px;
    background-color: #FC8;
    color: #C20;
    text-decoration: none;
    }

    #navbar2 li a:hover {
    display: block;
    padding: 3px 8px;
    background-color: #C20;
    color: #FC8;
    text-decoration: none;
    }

    #navbar2 li ul {
    display: none;
    width: 10em;
    background-color: #FC8;
    }

    #navbar2 li:hover ul {
    display: block;
    position: absolute;
    margin: 0;
    padding: 0;
    background-color: #C20;
    color: #FC8;
    }

    #navbar2 li:hover li {
    float: none;
    }

    #navbar2 li:hover li a {
    background-color: #FD8;
    border-bottom: 1px solid black;
    border-right: 1px solid black;
    border-left: 1px solid black;
    color: #C20;
    }

    #navbar2 li li a:hover {
    background-color: #C20;
    color: #FC8;
    }

    --> </style>
    Thanks a lot.

  2. #2
    SitePoint Zealot sularome's Avatar
    Join Date
    Jan 2006
    Location
    Poland
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which IE version?

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,295
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    We need html to go with that so we can test and also as mentioned which version of IE do you have problems with.

    The above code won't work in IE6 as it doesn't understand hover on anything but anchors. It also won't work in any version of IE unless you have a current valid doctype.

  4. #4
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My IE is version 8. May I have an example of a current valid doctype?

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,295
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by JJLee View Post
    My IE is version 8. May I have an example of a current valid doctype?
    Html 4.01:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    xhtml 1.0:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    Html5:
    Code:
    <!DOCTYPE html>


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
  •