html - 如何在 bootstrap 4 中将卡片居中?

标签 html css bootstrap-4

我正在使用 bootstrap 4 alpha 3。
我想将卡片在页面中间水平居中。

预览/链接: http://codepen.io/vaibhavsingh97/full/VjRAXW

我已经尝试了卡片的 bootstrap 4 示例页面上列出的所有不同选项。

我怎样才能做到这一点?

最佳答案

为 .card 添加 css

.card {
        margin: 0 auto; /* Added */
        float: none; /* Added */
        margin-bottom: 10px; /* Added */
}

这里是 pen

更新: 您可以使用 bootstrap 4 中可用的类 .mx-auto 来居中卡片。

关于html - 如何在 bootstrap 4 中将卡片居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39031224/

相关文章:

html - 正常代码在 CSS 选项卡内工作异常

html - 使用 CSS 在鼠标悬停时显示不同的 'height' 链接

jquery - 带有 And 条件的 Css-Jquery

javascript - 在网页上写乐谱

javascript - 在其中也有链接的表行中使用 onClick

css - 使用 CSS 曲线

css - 禁用带有 CSS 覆盖和消息 "No data to show"的虚拟 highcharts 图。 AngularJS,没有 jQuery

css - 如何在 django 元素中使用 bootstrap 样式

javascript - Bootstrap 日期时间选择器步进不起作用

javascript - 如何根据收到的值更改按钮?