html - 如何在页面两侧设置两个 div?
问题描述
我在 div 中设置元素时遇到问题。如何设置显示左侧页面上的元素数量和右侧的搜索
这是代码的一部分:
<div class="header-size-section">
<div class="lable-size-section">
<select class="form-control size-list" id="table-size-list" name="table-size-list" onchange="tableSizeChanged(this)">
<option>25</option>
<option>50</option>
<option>100</option>
<option>all</option>
</select>
</div>
<div class="header-search-section">
<span class="table-search-list">Search: </span>
<input type="text" class="search-table" />
</div>
</div>
解决方案
注意:(
.header-size-section
将 display: flex 更改为 display: block)和.header-size-section>.header-search-section
(你错过了点)
.bootstrap-table .table:not(.table-condensed),
.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,
.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,
.bootstrap-table .table:not(.table-condensed)>thead>tr>td,
.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,
.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td {
padding: 2px 3px 2px 3px;
}
.header-size-section {
display: block;
font-weight: 600;
margin-bottom: 2px;
}
.size-list {
padding-bottom: 1px;
padding-top: 1px;
}
.table-search-list {
margin: 0px;
display: table-cell;
vertical-align: middle;
padding: 6px;
}
.search-table {
padding: 0.375rem 0.75rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.header-search-section,
.lable-size-section {
display: inline-table;
}
.header-size-section>.header-search-section {
float: right;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="header-size-section justify-content-between">
<div class="lable-size-section">
<select class="form-control size-list" id="table-size-list" name="table-size-list" onchange="tableSizeChanged(this)">
<option>25</option>
<option>50</option>
<option>100</option>
<option>all</option>
</select>
</div>
<div class="header-search-section">
<span class="table-search-list">Search: </span>
<input type="text" class="search-table" />
</div>
</div>
推荐阅读
- vb.net - 如果我在访问文件中添加数据,但当通过应用程序输入数据时,我的表工作正常
- c++ - 如何选择用于 GitHub Actions 作业的 C/C++ 编译器?
- database - 是否可以将空手道自动化测试扩展到多个从属 VM 或 Kubernetes 集群?
- filesystems - Mac OS Mojave:“您的磁盘几乎已满”消息 - “系统”占用大量空间
- kubernetes - Kube 代理 - 将不会使用 IPVS 代理,因为未加载以下必需的内核模块:[ip_vs_wrr ip_vs_sh]
- maven - Maven依赖版本,使用一个版本或另一个
- php - 除法总是除以 1 而不是 var (float)
- asp.net - 我希望下拉列表的第一个元素为空
- c# - 使用 Microsoft 消息队列的 Receive() 方法出现问题
- python - 自动生成 Click 命令的所有帮助文档