使用html和css帮我写登录页面,若未有账号,点击跳转至注册页面
时间: 2023-06-12 16:06:14 浏览: 54
好的,以下是一个简单的登录页面的HTML和CSS代码,包括一个跳转到注册页面的链接按钮:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
form {
background-color: white;
max-width: 500px;
margin: 50px auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-radius: 5px;
}
input[type="text"], input[type="password"] {
display: block;
width: 100%;
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
border: none;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
a {
display: block;
text-align: center;
margin-top: 20px;
color: #666;
text-decoration: none;
}
a:hover {
color: #333;
}
</style>
</head>
<body>
<form>
<h2>Login</h2>
<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>
<a href="register.html">Don't have an account? Register here.</a>
</body>
</html>
```
请注意,此代码仅用于示范目的。在实际应用中,应该使用更强大的安全措施来保护用户的登录信息,例如使用HTTPS协议和加密存储密码。