急~!!求救。。CSS下拉菜单问题,请大家帮忙啊!!
我小菜一个,CSS和JAVASCRIPT都不太懂,现在给一个主页面加了一个CSS的下拉菜单,代码是网上找的。
现在遇到的问题是:高分辨率的情况下,手动更改窗口大小后,出现外面一层滚动条,里面又多了一个滚动条(里层的滚动条有我自定义的CSS,这是我想要的效果),
随着里层滚动条的移动,定义好的下拉菜单模块会错位。。不知道是怎么回事了,网上找了好多天,还没有解决,项目马上要上交了。请大家帮帮忙啊。。
小弟感激不尽。。。。。。。
我的页面结构有点乱,代码如下。
————————————————————————————————————————————————————————————
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-family:simsun,PMingliU,MS PGothic,Arial;
color: 595959;
font-size: 14px;
line-height: 18px;
background-image: url(/library/images/backgrand.jpg);
background-position: center top;
margin-top:0;
margin-left:0;
margin-right:0;
margin-bottom:0;
OVERFLOW:auto;
SCROLLBAR-FACE-COLOR:#D4D0C7;
SCROLLBAR-HIGHLIGHT-COLOR: #002339;
SCROLLBAR-SHADOW-COLOR: #002339;
SCROLLBAR-3DLIGHT-COLOR: #ffffff;
SCROLLBAR-ARROW-COLOR: #002339;
SCROLLBAR-TRACK-COLOR: #fffafa;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
* {
padding:0;
margin:0;
}
#navigation, #navigation li ul {
list-style-type:none;
}
#navigation li {
float:left;
text-align:center;
position:relative;
}
#navigation li a:link{
display:block;
text-decoration:none;
color:#ffffff;
width:138px;
height:25px;
line-height:25px;
border:1px solid #fff;
border-width:0px 1px 0px 1px;
background:#6D360D;
}
#navigation li a:link, #navigation li a:visited {
display:block;
text-decoration:none;
color:#ffffff;
width:138px;
height:25px;
line-height:25px;
border:1px solid #fff;
border-width:1px 1px 0px 1px;
background:#6D360D;
}
#navigation li a:hover {
color:#fff;
background:#CEC7B5;
}
#navigation li ul li a:hover {
color:#fff;
background:#CEC7B5;
}
#navigation li ul {
display:none;
position: absolute;
top:25px;
left:0;
margin-top:1px;
width:138px;
}
#navigation li ul li ul {
display:none;
position:absolute;
top:0px;
left:138px;
margin-top:0;
margin-left:1px;
width:138px;
}
.main {
HEIGHT: auto;
//min-height:600px;
WIDTH: 1000px;
OVERFLOW: hidden;
}
.headleft {
float:left;
HEIGHT: 94px;
WIDTH: 710px;
overflow:hidden;
}
.headright {
font-family:simsun,PMingliU,MS PGothic,Arial;
color: 595959;
font-size: 14px;
line-height: 18px;
float:left;
HEIGHT: 94px;
WIDTH: 290px;
overflow:hidden;
background:#CCCC99;
}
.headbottom {
float: left;
HEIGHT: 100%;
WIDTH: 1000px;
overflow:hidden;
}
.center1{
float:left;
height:auto;
HEIGHT: 470px;
min-height:470px;
WIDTH: 1000px;
}
.foot {
width:1000px;
height:50px;
font-size: 12px;
color:#FFFFFF;
line-height: 18px;
background: #6D360D;
margin-top:0;
margin-left:0;
margin-right:0;
margin-bottom:0;
OVERFLOW:hidden;
float:left;
}
</style>
<script type="text/javascript">
function displaySubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "block";
}
function hideSubMenu(li) {
var subMenu = li.getElementsByTagName("ul")[0];
subMenu.style.display = "none";
}
</script>
</head>
<body>
<center>
<div class="main">
<div style="width:100%; height:94px">
<iframe width="100%" height="100%" frameborder="0" src="topnew.jsp">
</iframe>
</div>
<div id="headbottom" class="headbottom">
<table width="100%" height="29" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td scope="col" width="141" height="29" nowrap><a href="1.html" target="bottomFrame"><img id="an_1_1.jpg" src="an_1_1.jpg "width="141" height="29" border="0" onClick="skip(1)"></a></td>
<td scope="col" width="141" height="29" nowrap><a href="2.html" target="bottomFrame"><img id="an_2_1.jpg" src="an_2_1.jpg" width="141" height="29" border="0" onClick="skip(2)"></a></td>
<td scope="col" width="141" height="29"><a href="3.html" target="bottomFrame"><img id="an_3_1.jpg" src="an_3_1.jpg" width="141" height="29" border="0" onClick="skip(3)"></a></td>
<td scope="col" width="141" height="29"><a href="4.html" target="bottomFrame"><img id="an_4_1.jpg" src="an_4_1.jpg" width="141" height="29" border="0" onClick="skip(4)"></a></td>
<td height="29" width="141" ><ul id="navigation">
<li onMouseOver="displaySubMenu(this)" onMouseOut="hideSubMenu(this)"> <a href="#">帮助</a>
<ul>
<li onMouseOver="displaySubMenu(this)" onMouseOut="hideSubMenu(this)"> <a href="#">1</a>
<ul>
<li><a href="#" target="_blank">1.1</a></li>
<li><a href="#" target="_blank">1.2</a></li>
<li><a href="#" target="_blank">1.3</a></li>
</ul>
</li>
<li onMouseOver="displaySubMenu(this)" onMouseOut="hideSubMenu(this)"> <a href="#">2</a>
<ul>
<li><a href="#" target="_blank">2.1</a></li>
<li><a href="#" target="_blank">2.2</a></li>
<li><a href="#" target="_blank">2.3</a></li>
</ul>
</li>
<li onMouseOver="displaySubMenu(this)" onMouseOut="hideSubMenu(this)"> <a href="#">3</a>
<ul>
<li><a href="#" target="_blank">3</a></li>
<li><a href="#" target="_blank">3</a></li>
<li><a href="#" target="_blank">3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</td>
<td scope="col" height="29" width="100%">
<img id="tiao.jpg" src="tiao.jpg" width="100%" height="29" border="0" ></td>
</tr>
</table>
</div>
<div id="center1" class="center1">
<iframe name="bottomFrame" id="centerframe" src="news/center.jsp" width="1000" height="470" scrolling="no" frameborder="0"> </iframe>
</div>
<div id="foot" class="foot" >
<table width="1000" height="50" cellpadding="0" ccellspacing="0" border="0">
<tr align="center">
<td><span style="font-size:12px; color:#FFFFFF">Ȩ</span></td>
</tr>
<tr align="center">
<td ><span style="font-size:12px; color:#FFFFFF">֧</span></td>
</tr>
</table>
</div>
</div>
</center>
</body>
</html>
——————————————————————————————————————————————————