所以,我有这个代码
<div class="featurette">
<img class="featurette-image pull-right" src="img/BreadBakersGuildLogo.jpg">
<div class="text-center">
<h2>Justin</h2>
<p class="lead">
Stuff about Justin
</p>
</div>
<div class="pull-left">
<ul>
<li>Stuff about contacts</li>
<li>Stuff</li>
</ul>
</div>
</div>
不幸的是,text-center 下的文本未居中。好像有点偏左。我还做了this fiddle 来证明我的意思。
谢谢!
最佳答案
问题是:
您正在使用.container
对于 <body>
其中有 width: 940px
和p
有一个display: block
并且它是引用 940px 进行渲染的。
一种解决方案是使用 .container{ width: 100%}
,因为您稍后也可能会遇到此问题。
关于php - 使用 Bootstrap 居中内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16720303/