gpt4 book ai didi

html - Bootstrap 列未正确中断

转载 作者:太空宇宙 更新时间:2023-11-04 01:41:53 27 4
gpt4 key购买 nike

我的 bootstrap 列坏了,因此在 sm 视口(viewport)上,一行有两列,下一列有一列。在 xs View 端口上,每列相互堆叠。

html:

<div class=" row">
<div class="sandwich-item col-sm-4 col-xs-6">
<h2>hello</h2>
</div>
<div class="sandwich-item col-sm-4 col-xs-6">
<h2>hello</h2>
</div>
<div class="sandwich-item col-sm-4 col-xs-6">
<h2>hello</h2>
</div>
</div>

CSS:

.sandwich-item{
border: 2px solid #390000;
margin-right: 10px;
}
.sandwich-item h2 {
font-size: 18px;
font-weight: bold;
}

小视口(viewport): enter image description here

超小视口(viewport)

enter image description here

最佳答案

.sandwich-item {
border: 2px solid #390000;
}

.sandwich-item h2 {
font-size: 18px;
font-weight: bold;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class=" row">
<div class="col-sm-4 col-xs-6">
<div class="sandwich-item">
<h2>hello</h2>
</div>
</div>
<div class="col-sm-4 col-xs-6">
<div class="sandwich-item">
<h2>hello</h2>
</div>
</div>
<div class="col-sm-4 col-xs-6">
<div class="sandwich-item">
<h2>hello</h2>
</div>
</div>
</div>

您的 margin-right: 10px; 会打断列。

关于html - Bootstrap 列未正确中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45257593/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com