【发布时间】:2018-08-14 20:08:42
【问题描述】:
我想在输入下的 list-group (Bootstrap) 中显示搜索结果,我是 hovering my mouse。
如果我在搜索 div 之后列出一个列表,屏幕顶部的 it starts。
如何将列表置于搜索下方?
body,
html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.content {
font-family: 'Cutive Mono', monospace;
}
.search {
top: 37%;
left: 50%;
transform: translate(-50%, -50%);
position: absolute;
font-weight: 100;
}
<div class="content">
<div class="search">
INPUT
</div>
<div class="list-group">
LIST ITEMS
</div>
</div>
【问题讨论】:
-
.search元素是绝对定位的,因此它已从文档流中移除。您可能希望将列表包含在绝对定位的元素中,或者以不同的方式构建文档。
标签: html css twitter-bootstrap layout