html+css+js登录页面
时间: 2023-08-28 11:06:49 浏览: 53
好的,我可以为你提供一个简单的HTML+CSS+JS登录页面的示例代码,如下所示:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<h2>登录</h2>
<form>
<p>用户名</p>
<input type="text" name="username" placeholder="请输入用户名">
<p>密码</p>
<input type="password" name="password" placeholder="请输入密码">
<input type="submit" name="submit" value="登录">
</form>
</div>
<script src="script.js"></script>
</body>
</html>
```
CSS代码:
```
body {
background-color: #e6e6e6;
}
.login-box {
width: 400px;
height: 400px;
background-color: #fff;
margin: 100px auto;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.25);
}
h2 {
text-align: center;
margin-bottom: 30px;
}
form {
display: flex;
flex-direction: column;
}
p {
margin-bottom: 5px;
}
input[type="text"], input[type="password"] {
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
border: none;