为什么Bootstrap 4行之间没有垂直空间 [英] Why is there no vertical space between Bootstrap 4 rows

查看:62
本文介绍了为什么Bootstrap 4行之间没有垂直空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试从Bootstrap 3迁移到Bootstrap4.Bootstrap3默认情况下在行之间具有垂直间隔,但是在Bootstrap 4中却不是这种情况.有人可以解释一下原因吗?或者我在HTML中缺少某些内容?

I am trying to migrate from Bootstrap 3 to Bootstrap 4. Bootstrap 3 had vertical space between rows by default, but this is not the case in Bootstrap 4. Can someone please explain why? Or am I missing something in my HTML?

<div class="container-fluid">
    <div class="row">
        <div class="col-9">
            <div class="row">
                <div class="col">
                    <div class="card">
                        <div class="card-header">
                            Card01
                        </div>
                        <div class="card-body">
                            Card01
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <div class="card">
                        <div class="card-header">
                            Card02
                        </div>
                        <div class="card-body">
                            Card02
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

推荐答案

行在Bootstrap 4中不再具有margin-bottom.使用新的间距实用程序(mb-4).

Rows no longer have margin-bottom in Bootstrap 4. Use the new spacing utils (mb-4).

请参见 https://stackoverflow.com/a/42960338/171456 .

这篇关于为什么Bootstrap 4行之间没有垂直空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆