html登录页面代码css样式
时间: 2024-05-18 14:08:55 浏览: 15
以下是一个简单的HTML登录页面代码及CSS样式:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<form>
<h2>Login</h2>
<input type="text" name="username" placeholder="Username">
<input type="password" name="password" placeholder="Password">
<button type="submit">Login</button>
</form>
</body>
</html>
```
CSS样式:
```css
form {
background-color: #f2f2f2;
padding: 20px;
border-radius: 10px;
width: 300px;
margin: 0 auto;
text-align: center;
}
h2 {
color: #555;
font-family: Arial, sans-serif;
margin-bottom: 20px;
}
input[type="text"], input[type="password"] {
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
border: none;
width: 100%;
}
button[type="submit"] {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
button[type="submit"]:hover {
background-color: #3e8e41;
}
```
以上代码实现了一个简单的登录页面,包含了一个表单,表单中包含了用户名和密码两个输入框,以及一个登录按钮。CSS样式实现了表单的样式美化,使其看起来更加美观。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)