用hbuilder写一个登录界面
时间: 2023-10-13 11:04:30 浏览: 96
好的,下面是一个简单的登录界面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录界面</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
.container {
width: 400px;
margin: 100px auto 0;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
border-radius: 5px;
}
h2 {
text-align: center;
margin-bottom: 20px;
}
label {
display: inline-block;
width: 80px;
text-align: right;
margin-right: 10px;
font-weight: bold;
}
input[type="text"],
input[type="password"] {
width: 200px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 3px;
margin-bottom: 10px;
}
input[type="submit"] {
display: block;
width: 100%;
background-color: #009688;
color: #fff;
padding: 10px;
border: none;
border-radius: 3px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #008080;
}
</style>
</head>
<body>
<div class="container">
<h2>用户登录</h2>
<form>
<label>用户名:</label>
<input type="text" name="username" required><br>
<label>密 码:</label>
<input type="password" name="password" required><br>
<input type="submit" value="登录">
</form>
</div>
</body>
</html>
```
这个登录界面包括一个标题,一个表单和一个提交按钮。用户需要输入用户名和密码才能登录。这个界面还使用了一些 CSS 样式来美化界面,包括边框、背景色、阴影等等。您可以将这个代码示例复制到 HBuilder 中,然后保存为一个 HTML 文件,然后在浏览器中打开它,就可以看到这个登录界面了。