如何添加边缘顶部类="行"元素使用twitter引导框架?
当前回答
在Twitter引导中编辑或重写行是一个坏主意,因为这是页面脚手架的核心部分,您将需要没有顶部边距的行。
要解决这个问题,可以创建一个新类“top-buffer”,添加所需的标准裕度。
.top-buffer { margin-top:20px; }
然后在需要上边距的行div上使用它。
<div class="row top-buffer"> ...
其他回答
我将这些类添加到引导样式表中
.voffset { margin-top: 2px; }
.voffset1 { margin-top: 5px; }
.voffset2 { margin-top: 10px; }
.voffset3 { margin-top: 15px; }
.voffset4 { margin-top: 30px; }
.voffset5 { margin-top: 40px; }
.voffset6 { margin-top: 60px; }
.voffset7 { margin-top: 80px; }
.voffset8 { margin-top: 100px; }
.voffset9 { margin-top: 150px; }
例子
<div class="container">
<div class="row voffset2">
<div class="col-lg-12">
<p>
Vertically offset text.
</p>
</div>
</div>
</div>
just take a new class beside every row and apply css of margin-top: 20px;
here is the code below
<style>
.small-top
{
margin-top: 25px;
}
</style>
<div class="row small-top">
<div class="col-md-12">
</div>
</div>
在.css文件中添加到这个类:
.row {
margin-left: -20px;
*zoom: 1;
margin-top: 50px;
}
或者创建一个新类并将其添加到元素中
.rowSpecificFormName td {
margin-top: 50px;
}
只需简单地使用这个bs3-upgrade帮助空格和文本对齐…
https://github.com/studija/bs3-upgrade
引导5
在Bootstrap 5中,你可以这样做:
<div class="row mt-X"></div>
其中X是从0(没有空格)到5(有很多空格)之间的数字。关于不同的边距/填充大小和特定于断点的控件的更多信息,请查看文档。