html和css写登录框
页面如下:
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录框</title>
<link rel="stylesheet" href="./font_2640846_nirlsbslt9/iconfont.css">
<style type="text/css">
body {
background-image: url(img/1.jpg);
background-repeat: no-repeat;
background-size: 100% auto;
}
.div-sign {
width: 450px;
height: 260px;
margin: 0 auto;
margin-top: 15%;
text-align: center;
background-color: #00000080;
}
.div-sign>h2 {
color: #fff;
font-size: 30px;
}
.div-sign span {
font-size: 41px;
vertical-align: middle;
}
#username,
#password {
width: 103px;
height: 34px;
/*设置下边框*/
border: 0px;
border-bottom: 2px solid #fff;
/*设置内边距*/
padding: 5px 17px;
background-color: #ffffff00;
/*字体颜色*/
color: #fff;
/*字体大小*/
font-size: 22px;
}
[type="button"] {
border: 1px solid red;
width: 120px;
margin-top: 17px;
font-size: 22px;
background-image: linear-gradient(to right, #ad3125 0%, #578bc3 100%);
border-radius: 15px;
}
</style>
</head>
<body>
<div class="div-sign">
<h2>登录</h2>
<form action="#" method="post">
<label for="username">
<span class="iconfont icon-icon"></span>
</label>
<input type="text" id="username" name="username" placeholder="username">
<br />
<label for="password">
<span class="iconfont icon-yuechi"></span>
</label>
<input type="password" id="password" name="password" placeholder="password">
<br />
<input type="button" value="登录">
</form>
</div>
</body>
</html>