写一个好看的html注册登录页面
时间: 2023-11-27 16:05:10 浏览: 25
以下是一个简单的注册登录页面的示例代码,你可以自己根据需要进行修改美化:
```html
<!DOCTYPE html>
<html>
<head>
<title>注册登录页面</title>
<meta charset="utf-8">
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
font-size: 16px;
color: #333;
}
.container {
margin: 50px auto;
padding: 20px;
width: 400px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
margin-top: 0;
text-align: center;
}
form {
display: flex;
flex-direction: column;
align-items: center;
}
input[type="text"], input[type="password"] {
margin: 10px 0;
padding: 10px;
width: 100%;
border: none;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
input[type="submit"] {
margin: 20px 0;
padding: 10px;
width: 100%;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
p {
margin: 10px 0;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h2>注册</h2>
<form action="#" method="post">
<input type="text" name="username" placeholder="用户名">
<input type="password" name="password" placeholder="密码">
<input type="submit" value="注册">
</form>
<p>已有账号?<a href="#">点击登录</a></p>
</div>
<div class="container">
<h2>登录</h2>
<form action="#" method="post">
<input type="text" name="username" placeholder="用户名">
<input type="password" name="password" placeholder="密码">
<input type="submit" value="登录">
</form>
<p>还没有账号?<a href="#">点击注册</a></p>
</div>
</body>
</html>
```
效果如下图所示:
![注册登录页面](https://i.imgur.com/EXfRjEe.png)