当前位置: 代码迷 >> HTML/CSS >> 横向导航条页面被撑开,就高手指教解决方法
  详细解决方案

横向导航条页面被撑开,就高手指教解决方法

热度:118   发布时间:2012-06-05 13:54:06.0
横向导航条页面被撑开,就高手指教
本人正在做一个横向导航条,但是下拉菜单总是把页面撑开,试过很多方法都不行,请高手帮我看看,下面是Html代码

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <link href="App_Themes/StyleSheet.css" rel="stylesheet" type="text/css" />


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div class="menulearn" >
<ul >
<li class="MenuLi" ><a href="../Default.aspx"class="mainmenu" cname="主菜单导航" oname="主 页" otype="文字链接">主 页</a>

</li>

<li class="MenuLi" ><a id="mainmenuxx" href="../Default.aspx" onmouseout="Hind(event,'menuxx','mainmenuxx')" onmouseover="ShowMenu('menuxx','mainmenuxx')" class="mainmenu" cname="主菜单导航" oname="在线学习" otype="文字链接" >在线学习</a>
<div id="menuxx" class="menulist" onmouseout="Hind(event,'menuxx','mainmenuxx')" >

<a href="../Default.aspx" class="submenu" cname="主菜单导航" oname="在线学习" otype="文字链接" >在线学习</a>
<a href="../Default.aspx" class="submenu" cname="主菜单导航" oname="在线学习" otype="文字链接" >在线学习</a>
<a href="../Default.aspx" class="submenu" cname="主菜单导航" oname="在线学习" otype="文字链接" ><span>在线学习</span></a></div>
</li>

<li class="MenuLi" ><a id="mainmenucs" href="" onmouseout="Hind(event,'menucs','mainmenucs')" onmouseover="ShowMenu('menucs','mainmenucs')" class="mainmenu" cname="主菜单导航" oname="在线测试" otype="文字链接">在线测试</a>

<div id="menucs" class="menulist" onmouseout="Hind(event,'menucs','mainmenucs')"></div>

</li>

<li class="MenuLi" ><a href="../buider.aspx" class="mainmenu" cname="主菜单导航" oname="在线论坛" otype="文字链接">在线论坛</a></li>

<li class="MenuLi" ><a href="../Master/Master.aspx" class="mainmenu" cname="主菜单导航" oname="系统管理" otype="文字链接">系统管理</a></li>

</ul>
</div>


<div style=" position:absolute; z-index:1; width:249px; height:200px; border-right:thin dotted; border-top: thin dotted; border-left: thin dotted; border-bottom: thin dotted"><a>测试效果</a><a>测试效果</a><a>测试效果</a><a>测试效果</a><a>测试效果</a><a></a></div>
</form>
</body>
<script type="text/javascript">
function ShowMenu(menu,mainmenu)
{
  if(document.getElementById(mainmenu)&&document.getElementById(mainmenu).className!="CurMenu")
  document.getElementById(mainmenu).className="CurMenu";
  if(document.getElementById(menu)&&document.getElementById(menu).style.visibility!="visible")
  document.getElementById(menu).style.visibility="visible";
}

function Hind(e,menu,mainmenu)
{  
  if(!isMouseToSubMenu(e, menu))
  {
  if(document.getElementById(menu)&&document.getElementById(menu).style.visibility!="hidden")
  相关解决方案