htmlcss登录注册页面
时间: 2023-09-20 17:06:20 浏览: 42
以下是一个简单的 HTML/CSS 登录注册页面的示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login/Register Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f9f9f9;
}
h1 {
margin-top: 0;
}
form {
display: flex;
flex-direction: column;
align-items: center;
background-color: #ffffff;
padding: 30px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
input[type="text"], input[type="password"] {
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 300px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #ffffff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
.link {
margin-top: 20px;
text-align: center;
}
.link a {
color: #4CAF50;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Login or Register</h1>
<form action="#" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
<div class="link">
<a href="#">Create an account</a>
</div>
</div>
</body>
</html>
```
这个页面包括一个标题,一个登录表单和一个注册链接。CSS 样式定义了基本的布局和样式,包括一个容器,一个表单和一些输入字段。