写一个登陆页面,包含用户名、密码、记住我、登录按钮
时间: 2023-05-21 15:07:07 浏览: 146
这是一个比较简单的网页设计问题,你可以使用HTML、CSS和JavaScript来实现。以下是一个示例代码,仅供参考:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录页面</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
text-align: center;
margin-top: 100px;
}
fieldset {
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
width: 300px;
margin: 0 auto;
}
input[type="text"], input[type="password"] {
padding: 8px;
margin: 10px 0;
width: 100%;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type="checkbox"] {
margin-right: 5px;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
padding: 10px 20px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>登录</legend>
<label for="username">用户名:</label><br>
<input type="text" id="username" name="username" placeholder="请输入用户名"><br>
<label for="password">密码:</label><br>
<input type="password" id="password" name="password" placeholder="请输入密码"><br>
<input type="checkbox" id="remember" name="remember">
<label for="remember">记住我</label><br><br>
<input type="submit" value="登录">
</fieldset>
</form>
</body>
</html>
```
这段代码中包含一个表单`<form>`,里面有一个`<fieldset>`元素,包含用户名和密码的两个`<input>`表单控件,以及一个记住我的`<input>`复选框和一个登录`<input>`提交按钮。CSS样式可以让这些控件看起来更美观。当用户填写好用户名和密码后,点击登录按钮即可提交表单到服务器端进行验证。