急求高手解决网站兼容性问题!!下拉菜单在IE6正常显示,在其他版本和非IE核心浏览器就不正常,下面是CSS
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
<!--
body {
color: #333;
text-align: center;
font: 12px/1.5 Tahoma, Helvetica, Arial, sans-serif;
}
#dlmenu {height:25px;}
#menu {list-style-type:none; margin:0 0 10px; padding:0; position:absolute; width:200px; background:#fff; z-index:100;}
#menu li {display:block; padding:0; margin:0; position:relative; z-index:100;}
#menu li a, #menu li a:visited {display:block; text-decoration:none;}
#menu li dd {display:none;}
#menu li:hover, #menu li a:hover {border:0;}
#menu li:hover dt a , #menu li a:hover dt a {background:#000 url(images/top_grad_2.gif) center center; color:#055ae7; }
#menu li:hover dd, #menu li a:hover dd {display:block;}
#menu li:hover dl, #menu li a:hover dl {height:20px; background:#055ae7 url(product/sub_grad.gif);}
#menu table {border-collapse:collapse; padding:0; margin:-4px; font-size:12px;}
#menu dl {width:200px; margin: 0; background: #6f9c6f; cursor:pointer;}
#menu dt {margin:0; padding: 0; font-size:12px; border-top:1px solid #cce;}
#menu dd {margin:0; padding:0; font-size:12px; text-align:left; }
.gallery dt a, .gallery dt a:visited {display:block; color:#000000; padding:5px 0px 5px 25px; background:url
(images/top_grad.gif) center center; font-size:11px;}
.gallery dd a, .gallery dd a:visited {color:#ff0000; min-height:15px; text-decoration:none; display:block; padding:10px 5px
4px 15px; background:#ccff00 url(images/sub_grad.gif);}
* html .gallery dd a, * html .gallery dd a:visited {height:15px;}
.gallery dd a:hover {background:#fff url(images/sub_grad_2.gif); color:#fff;}
-->
</style>
<script type="text/javascript">function $(id) {
return document.getElementById(id);
}
function showMenu (baseID, divID) {
baseID = $(baseID);
divID = $(divID);
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
showMenu.cur = divID;
if (! divID.isCreate) {
divID.isCreate = true;
//divID.timer = 0;
divID.onmouseover = function () {
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
};
function hide () {
showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
}
divID.onmouseout = hide;
baseID.onmouseout = hide;
}
function hideCur () {
showMenu.cur && (showMenu.cur.style.display = 'none');
}
}</script>
</head>
</html> 展开
<html>
<head>
<style type="text/css">
<!--
body {
color: #333;
text-align: center;
font: 12px/1.5 Tahoma, Helvetica, Arial, sans-serif;
}
#dlmenu {height:25px;}
#menu {list-style-type:none; margin:0 0 10px; padding:0; position:absolute; width:200px; background:#fff; z-index:100;}
#menu li {display:block; padding:0; margin:0; position:relative; z-index:100;}
#menu li a, #menu li a:visited {display:block; text-decoration:none;}
#menu li dd {display:none;}
#menu li:hover, #menu li a:hover {border:0;}
#menu li:hover dt a , #menu li a:hover dt a {background:#000 url(images/top_grad_2.gif) center center; color:#055ae7; }
#menu li:hover dd, #menu li a:hover dd {display:block;}
#menu li:hover dl, #menu li a:hover dl {height:20px; background:#055ae7 url(product/sub_grad.gif);}
#menu table {border-collapse:collapse; padding:0; margin:-4px; font-size:12px;}
#menu dl {width:200px; margin: 0; background: #6f9c6f; cursor:pointer;}
#menu dt {margin:0; padding: 0; font-size:12px; border-top:1px solid #cce;}
#menu dd {margin:0; padding:0; font-size:12px; text-align:left; }
.gallery dt a, .gallery dt a:visited {display:block; color:#000000; padding:5px 0px 5px 25px; background:url
(images/top_grad.gif) center center; font-size:11px;}
.gallery dd a, .gallery dd a:visited {color:#ff0000; min-height:15px; text-decoration:none; display:block; padding:10px 5px
4px 15px; background:#ccff00 url(images/sub_grad.gif);}
* html .gallery dd a, * html .gallery dd a:visited {height:15px;}
.gallery dd a:hover {background:#fff url(images/sub_grad_2.gif); color:#fff;}
-->
</style>
<script type="text/javascript">function $(id) {
return document.getElementById(id);
}
function showMenu (baseID, divID) {
baseID = $(baseID);
divID = $(divID);
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
showMenu.cur = divID;
if (! divID.isCreate) {
divID.isCreate = true;
//divID.timer = 0;
divID.onmouseover = function () {
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
};
function hide () {
showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
}
divID.onmouseout = hide;
baseID.onmouseout = hide;
}
function hideCur () {
showMenu.cur && (showMenu.cur.style.display = 'none');
}
}</script>
</head>
</html> 展开
展开全部
每种浏览器都自带有CSS文件,如果一个页面在浏览器加载页面后,发现没有CSS文件,那么浏览器就会自动调用它本身自带的CSS 文件,但是不同的浏览器自带的CSS文件又都不一样,对不同标签定义的样式不一样,如果我们想让做出的页面能够在不同的浏览器显示出来的效果都是一样的,那么我们就需要对HTML标签重置,就是上面的代码了,但是这样也有不好的地方,因为HTML4.01中有89个标签,所以相当于在页面加载CSS的时候,先对这89个标签都加上了{margin:0; padding:0;},
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询