Sib*_*Guy 79 twitter-bootstrap
这是我的第一个Twitter Bootstrap体验.我添加了一些标题(h1,h2等),它们在左侧对齐.以标题为中心的正确方法是什么?
小智 125
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
bootstrap为文本对齐添加了三个css类.
Sad*_*han 53
只需在元素中使用class ='text-center'作为中心标题.
<h2 class="text-center">sample center heading</h2>
Run Code Online (Sandbox Code Playgroud)
在左边标题的元素中使用class ='text-left',在元素中使用class ='text-right'作为右标题.
小智 16
只需在该行的class属性中使用“ justify-content-center”即可。
<div class="container">
<div class="row justify-content-center">
<h1>This is a header</h1>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
And*_*ich 11
根据您的意见,要将所有标题集中在一起,您需要同时添加所有标题text-align:center
,如下所示:
CSS
h1, h2, h3, h4, h5, h6 {
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
153425 次 |
最近记录: |