js下拉菜单

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <base href="<%=basePath%>">

    

    <style type="text/css">

    html,body{

    width:100%;

    height:100%

    padding:0;

            margin:0;

}

body{

background:url(${pageContext.request.contextPath}/image/login.png);

background-size:100%;

}

#tite{

width:94%;height:13%;

background-color:rgba(0,0,0,0.1);

margin:10 auto;

border-radius:10px;

}

#caidan{

width:20%;

background-color:rgba(0,0,0,0.1);

border-radius:10px;

float:left;

margin-left:3%;

}

ul{

            list-style: none;

          }

li{

margin:30px 20px;

}

ul li{

             text-decoration:none;

             width: 100px;

             height: 50px;

             border-radius:10px;

             text-align: center;

             line-height: 50px;

             background-color:rgba(0,0,0,0.2);

             color:#97FFFF;

         }

</style>

<!-- 下拉菜单 -->

<script type="text/javascript">

window.onload=function(){

function Show(id)

{

var z = document.getElementById(id);

if(z.style.display=="block")

{

z.style.display="none";

}

else

{

     z.style.display="block";

   }

}

}


</script>

    <title>中国银行</title>

    

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">    

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->


  </head>

  

  <body>

<div id="tite">

<span style="font-size:50px">中国银行</span>

<span style="position:absolute;left:90%;top:10%">欢迎您,${username}</span>

</div>

<div id="caidan">

<ul>

<li onclick="Show(z1)">下拉菜单

          <ul id="z1">

            <li>下拉菜单</li>

        <li>下拉菜单</li>

<li>下拉菜单</li>

            </ul>

            </li>

        <li>下拉菜单</li>

        <li>下拉菜单</li>

</ul>

</div>

  </body>

</html>

大佬们看看我这有什么问题吗,下拉菜单重叠在一起了

笑傩
浏览 844回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript
Java