博主使用HTML+CSS制作了简单的登录界面的静态网页(PS:这是我们web需要完成的作业,做的比较简单,给大家参考一下),效果图如下所示:
下面直接上代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin:0%;
padding:0%;
}
html{
height: 100%;
}
body{
height: 100&;
}
.container{
height: 750px;
background-image: url("1.jpg");
background-repeat: repeat;
}
.login-wrapper{
width: 540px;
height: 260px;
background-color: rgb(255, 255, 255,0.4);
transform: translate(150%,85%);
border-radius: 15px;
position: relative;
}
.login-header{
text-align: center;
height: 75px;
}
.username{
height: 40px;
text-align: center;
font-size: 18px;
}
.password{
height: 40px;
text-align: center;
font-size: 18px;
}
.login-butter{
width: 500px;
}
.btn{
width: 95px;
height: 48px;
text-align: center;
font-size: 14px;
border-radius: 5px;
background-color:rgb(176,224,230);
transform: translate(255%,10%);
}
</style>
</head>
<body>
<div class="container">
<div class="login-wrapper">
<div class="login-header">
<h1>登录</h1>
</div>
<form action="#" method="get">
<div class="username">
账号:<input type="text" name="username">
</div>
<div class="password">
密码:<input type="password" name="password" >
</div>
</form>
<div class="login-button">
<button class="btn">确定</button>
</div>
</div>
</div>
</body>
</html>
(PS:如果想要背景图的小伙伴也可以直接私信我,我看到的话会给你的)