制作一个模仿Facebook风格的用户名密码登录/注册的html页面
时间: 2023-09-08 12:07:25 浏览: 49
以下是一个简单的HTML页面,模仿Facebook风格的用户名密码登录/注册页面。可以根据自己的需求进行修改和美化。
```html
<!DOCTYPE html>
<html>
<head>
<title>Facebook登录</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
background-color: #f0f2f5;
font-family: Arial, sans-serif;
}
.container {
margin: 100px auto;
max-width: 400px;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
border-radius: 5px;
}
h1 {
font-size: 28px;
font-weight: normal;
text-align: center;
margin-bottom: 20px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
font-size: 16px;
}
input[type="submit"] {
display: block;
margin: 20px auto;
background-color: #1877f2;
color: #fff;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
transition: background-color 0.3s;
}
input[type="submit"]:hover {
background-color: #1565c0;
}
.center {
text-align: center;
}
a {
color: #1877f2;
text-decoration: none;
font-size: 16px;
transition: color 0.3s;
}
a:hover {
color: #1565c0;
}
</style>
</head>
<body>
<div class="container">
<h1>Facebook登录</h1>
<form action="#" method="post">
<label for="username">用户名或电子邮件地址</label>
<input type="text" id="username" name="username" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="登录">
<div class="center">
<a href="#">忘记密码?</a>
</div>
<hr>
<div class="center">
<a href="#">创建新帐户</a>
</div>
</form>
</div>
</body>
</html>
```
该页面包括一个登录表单,包含用户名或电子邮件地址和密码输入框,以及登录按钮。页面还包括一个忘记密码的链接和一个创建新账户的链接。在页面中使用了简单的CSS样式来美化表单。