用html写一个现代科技风的登录页面
时间: 2023-09-24 08:02:34 浏览: 31
好的,以下是一个简单的现代科技风格的登录页面的 HTML 代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<style>
body {
background-color: #f2f2f2;
}
form {
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 100px auto;
padding: 50px;
max-width: 500px;
}
h2 {
color: #333;
font-size: 28px;
margin-bottom: 30px;
text-align: center;
}
label {
color: #666;
display: block;
font-size: 18px;
margin-bottom: 10px;
}
input[type="text"],
input[type="password"] {
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
display: block;
font-size: 18px;
margin-bottom: 20px;
padding: 10px;
width: 100%;
}
button {
background-color: #4CAF50;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-size: 18px;
margin-top: 20px;
padding: 10px;
width: 100%;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #3e8e41;
}
.fa-lock {
color: #4CAF50;
font-size: 48px;
margin: 0 auto 30px;
display: block;
text-align: center;
}
</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>
<button type="submit">Login</button>
<i class="fas fa-lock"></i>
</form>
</body>
</html>
```
此代码可实现一个简单的登录页面,具有现代科技风格,其中包括一个带有字体图标的锁形状的图标,用于表示登录的安全性。请注意,此代码仅用于示例目的,实际项目中可能需要更多的功能和安全性措施。