通过四处搜索,我知道之前有人问过这个问题,我只是......不明白这里出了什么问题。
我已经尝试了大约一百万个不同的 Angular ,但就是无法让我的文字居中。
如果有人知道这笔交易是什么并愿意告诉我,那就太好了。
<div class="row-fluid text-center">
<h1 class="span12">Foobar's Contacts</h1>
</div>
除其他事项外,我已经尝试将 text-center
类移动到 h1
元素。
编辑:我能够将其更改为此并将标题居中。这种方法有什么缺点吗?
<div class="offset4 span4 text-center">
<h1 class="span8">Foobar's Contacts</h1>
</div>
最佳答案
尝试输入 <h1>
在 <div>
内指定跨度。就像是
<div class="row-fluid">
<div class="span12 text-center">
<h1>name's Contacts</h1>
</div>
</div>
如果你试图在 <div>
中将文本居中,我真的不明白,或整个页面。如果您希望您的页面居中,请使用类似
<div class="container">
.
.
<div class="row-fluid">
<div class="span12 text-center">
<h1>name's Contacts</h1>
</div>
</div>
.
.
</div>
希望对您有所帮助。
关于html - 使用 Bootstrap 2.3.1 居中文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15712653/