如何添加边缘顶部类="行"元素使用twitter引导框架?
当前回答
引导5
在Bootstrap 5中,你可以这样做:
<div class="row mt-X"></div>
其中X是从0(没有空格)到5(有很多空格)之间的数字。关于不同的边距/填充大小和特定于断点的控件的更多信息,请查看文档。
其他回答
<div class="row row-padding">
简单的代码
只需简单地使用这个bs3-upgrade帮助空格和文本对齐…
https://github.com/studija/bs3-upgrade
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>
我正在使用这些类来修改上边距:
.margin-top-05 { margin-top: 0.5em; }
.margin-top-10 { margin-top: 1.0em; }
.margin-top-15 { margin-top: 1.5em; }
.margin-top-20 { margin-top: 2.0em; }
.margin-top-25 { margin-top: 2.5em; }
.margin-top-30 { margin-top: 3.0em; }
当我需要一个元素与上面的元素有2em的间距时,我这样使用它:
<div class="row margin-top-20">Something here</div>
如果你喜欢像素,所以改变em到px有你的方式。
在.css文件中添加到这个类:
.row {
margin-left: -20px;
*zoom: 1;
margin-top: 50px;
}
或者创建一个新类并将其添加到元素中
.rowSpecificFormName td {
margin-top: 50px;
}