【问题标题】:Center content with Bootstrap使用 Bootstrap 居中内容
【发布时间】:2013-05-19 04:32:33
【问题描述】:

所以,我有这个代码

<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 小提琴来说明我的意思。

谢谢!

【问题讨论】:

    标签: php javascript twitter-bootstrap alignment


    【解决方案1】:

    问题是:

    您将.container 用于&lt;body&gt;,它有一个width: 940pxp 有一个display: block,它是参考940px 进行渲染的。

    一种解决方案是使用.container{ width: 100%},因为您稍后也可能会遇到此问题。

    【讨论】:

    • 除非您绝对需要容器,否则只需摆脱来自body的类
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-22
    • 1970-01-01
    • 2017-07-20
    相关资源
    最近更新 更多