帮我写一个前端登录界面
时间: 2023-08-28 16:35:30 浏览: 39
好的,以下是一个简单的前端登录界面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<style>
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
}
form {
background-color: #ffffff;
border-radius: 4px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 50px auto;
padding: 20px;
width: 300px;
}
label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
input[type="text"],
input[type="password"] {
border: 1px solid #cccccc;
border-radius: 3px;
font-size: 14px;
margin-bottom: 10px;
padding: 10px;
width: 100%;
}
button {
background-color: #4CAF50;
border: none;
border-radius: 3px;
color: #ffffff;
cursor: pointer;
font-size: 14px;
padding: 10px;
width: 100%;
}
button:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" placeholder="请输入用户名">
<label for="password">密码</label>
<input type="password" id="password" name="password" placeholder="请输入密码">
<button type="submit">登录</button>
</form>
</body>
</html>
```
这个登录界面包含了一个用户名输入框、一个密码输入框和一个登录按钮。你可以将这段代码保存为一个 HTML 文件,在浏览器中打开它来查看效果。如果需要,你可以根据自己的需求进行修改和完善。