如何在引导程序4中将图像居中? [英] How to center the image in bootstrap 4?

查看:68
本文介绍了如何在引导程序4中将图像居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Bootstrap 4的新手,之前在Bootstrap 3中,我们使用了中心块"类,现在我无法在新版本中找到它.

I am new to Bootstrap 4, earlier in Bootstrap 3 we use class "center-block", now I am not able to find this in new version.

推荐答案

这可以通过内置的.d-block完成:

This can be done with built-in .d-block:

<div class="container">
    <div class="row">
        <div class="col-4">
            <img class="mx-auto d-block" src="...">  
        </div>
    </div>
</div>

链接中的更多信息

这篇关于如何在引导程序4中将图像居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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