<html>
<head>
<meta http-equiv="Content-Type"content="text/html;charset=utf-8"/>
<title>登录页面</title>
<link href="demo.css"rel="stylesheet"/>
<script src="jquery-3.2.1.js"></script>
<script src="layer/layer.js"></script>
<script src="dadudenglu.js"></script>
</head>
<body>
<div id="header">
<div id="header-con">
<div><a href="javascript:;"id="blogin"οnclick="ShowLoginBox()">登录</a></div>
<div><a href="javascript:;"id="breg">注册</a></div>
</div>
</div>
<div id="loginbox">
<div class="box"><input type="text"id="txtUserName"placeholder="请输入用户名"/></div>
<div class="box"><input type="password"id="txtPwd"placeholder="请输入密码"></div>
<div class="box"><a href="javescript:;">登录</a></div>
</div>
</body>
</html>
*{
padding: 0px;
margin: 0px;
}
#header{
width: 100%;
height:40px;
background-color: #DDDDDD;
}
a {
text-decoration: none;
}
#header-con{
width: 900px;
height: 40px;
margin: 0px auto;
}
#header-con div {
float: right;
line-height: 40px;
margin-left: 10px;
}
#header-con div a {
color: black;
}
.box input{
width: 350px;
height: 40px;
}
.box a{
width: 354px;
height: 50px;
background-color: blue;
display: block;
text-align: center;
line-height: 50px;
color: white;
font-size: 40px;
font-family: times;
margin-top:50px;
}
.box {
margin-top:20px;
margin-left: 20px;
}
#loginbox{
display: none;
}
function ShowLoginBox()
{
layer.open({
type:1,
title:"登录",
area:["395px","300px"],
content:$("#loginbox")
});
}
第一次只能跟着老师一点一点学着做,光需要引入的就让我费了好长时间去找。希望自己以后能更加熟练。