用html写一个简洁查询页面
时间: 2023-09-27 09:12:02 浏览: 56
好的,下面是一个简洁的查询页面的HTML代码,包含一个查询表单和一个查询结果表格:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>简洁查询页面</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f1f1f1;
}
h1 {
margin: 20px 0;
text-align: center;
color: #333;
}
form {
margin: 20px auto;
text-align: center;
}
input[type="text"] {
padding: 10px;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px #ddd;
font-size: 16px;
width: 60%;
margin-right: 5px;
}
input[type="submit"] {
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #4CAF50;
color: #fff;
font-size: 16px;
cursor: pointer;
}
table {
margin: 20px auto;
border-collapse: collapse;
width: 80%;
background-color: #fff;
}
th, td {
padding: 10px;
border: 1px solid #ddd;
text-align: center;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:hover {
background-color: #f5f5f5;
}
</style>
</head>
<body>
<h1>简洁查询页面</h1>
<form method="get" action="">
<input type="text" name="keyword" placeholder="请输入关键字">
<input type="submit" value="查询">
</form>
<table>
<tr>
<th>姓名</th>
<th>年龄</th>
<th>性别</th>
</tr>
{% for item in results %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.age }}</td>
<td>{{ item.gender }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>
```
其中,表单使用GET方法提交查询请求,查询结果使用模板引擎的语法渲染。该页面使用了简洁的样式,清晰明了,易于使用。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)