前端登录界面html+css
时间: 2023-08-11 12:30:37 浏览: 71
好的,以下是一个简单的前端登录界面的HTML和CSS代码示例:
HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="login-box">
<h1>Login</h1>
<form>
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter Username">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter Password">
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
```
CSS代码:
```
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
.login-box {
background-color: #fff;
padding: 20px;
margin: 50px auto;
width: 300px;
box-shadow: 0px 0px 10px #888888;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
}
input[type=text], input[type=password] {
padding: 10px;
margin-bottom: 20px;
border: none;
border-radius: 5px;
box-shadow: 0px 0px 5px #888888;
}
input[type=submit] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #3e8e41;
}
```
这是一个简单的登录界面,包含用户名和密码输入框以及登录按钮,使用了简单的CSS样式来美化界面。当然,这只是一个示例,你可以根据自己的需要进行修改和优化。