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.

which IE version?

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.

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:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Html5:


<!DOCTYPE html>