html设计用户登录提示框
时间: 2023-08-17 22:17:22 浏览: 44
以下是一个简单的 HTML 用户登录提示框的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Prompt</title>
<style type="text/css">
body {
background-color: #f2f2f2;
}
#login-box {
background-color: #fff;
border: 1px solid #ccc;
box-shadow: 0 0 10px #ccc;
padding: 20px;
width: 300px;
margin: 0 auto;
margin-top: 100px;
}
label {
display: block;
font-size: 14px;
margin-bottom: 5px;
}
input[type="text"], input[type="password"] {
padding: 5px;
width: 100%;
border: 1px solid #ccc;
border-radius: 3px;
margin-bottom: 10px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
border: none;
padding: 10px;
border-radius: 3px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div id="login-box">
<h2>Login</h2>
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>
```
这个简单的登录提示框包括一个标题,一个表单,用户名和密码输入框以及一个登录按钮。CSS 样式定义了框的样式和输入字段的样式。你可以自己根据实际需要进行调整。