开发者

CSS Dropdown menu doesn't work in IE 8

i have a dropdown menu in css, it works fine in Chrome, FireFox, but not IE8, i haven't checked it in IE6/7. but it seems hopeless. my site at HERE. The dropdown menu is the black one开发者_StackOverflow. i think the problem is with the :hover, try searching around something like #button .a:hover, etc... but get no luck. I hope you can help. the css file is HERE

Thank you sirs


The problem is that you have not included a doctype on your website.

Because you haven't included a doctype, your page is rendering in Quirks mode in IE8:

Quirks mode is a rendering mode used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers or coded without standards conformance.

Add these two lines to the very top of your file:

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

If you add in that magical doctype line, your drop down works in IE8 and IE7.


You should move this part of your code to within your <body> tag.

<span style="float:right;margin-top:10px;">
<a href=?lang=vn><img src="img/vn.gif"></img></a> 
<a href=?lang=en><img src="img/us.gif"></img></a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</span>

Also, you can change it to something like this:

<div style="position:absolute; top:10px; right: 10px">
    <a href="?lang=vn"><img src="img/vn.gif"></img></a> 
    <a href="?lang=en"><img src="img/us.gif"></img></a>
</div>


When this sort of thing happens - go to Tools --> Compatibility Mode ; and make sure it's off. I have had similar issue and switching that off made my menu work properly (where it wasn't working at all).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜