制作一个美观的登录网页html代码
时间: 2023-06-07 10:07:38 浏览: 191
好的,以下是一个简单的登录页面的HTML代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<style>
body {
background-color: #f2f2f2;
}
h1 {
font-family: Arial, sans-serif;
text-align: center;
color: #333333;
}
form {
margin: 0 auto;
width: 400px;
padding: 20px;
background-color: #ffffff;
border-radius: 5px;
box-shadow: 0px 0px 10px #aaaaaa;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border-radius: 2px;
border: none;
background-color: #f7f7f7;
color: #333333;
box-sizing: border-box;
}
input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #007bff;
color: #ffffff;
border: none;
border-radius: 2px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
transition-duration: 0.3s;
}
input[type="submit"]:hover {
background-color: #0066cc;
}
</style>
</head>
<body>
<h1>登录</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="登录">
</form>
</body>
</html>
```
请注意,这仅仅是一个示例代码,你可以应用你自己的样式并添加必要的输入验证。