这是我第一次体验Twitter Bootstrap。我添加了一些标题(h1、h2等)。它们在左边对齐。将标题居中的正确方法是什么?
发布于 2013-03-01 14:02:02
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
bootstrap为文本对齐添加了三个css类。
发布于 2016-05-23 04:44:33
只需在<h>
元素中使用class='text-center'
作为中心标题:
<h2 class="text-center">sample center heading</h2>
左标题使用<h>
元素中的class='text-left'
,右标题使用<h>
元素中的class='text-right'
。
发布于 2018-10-29 02:47:37
只需在行的class属性中使用"justify-content-center“。
<div class="container">
<div class="row justify-content-center">
<h1>This is a header</h1>
</div>
</div>
https://stackoverflow.com/questions/11155046
复制相似问题