twitter-bootstrap Bootstrap 最大宽度列响应

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22233766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 20:13:39  来源:igfitidea点击:

Bootstrap max-width columns responsive

csstwitter-bootstraptext-align

提问by user3389584

I am trying to code a section of a one-page responsive Bootstrap design that has two side-by-side columns of text. The designer wants these two columns to have a max-width, but once it reaches its max, it is no longer centered (as the rest of the content continues to be responsive).

我正在尝试编写具有两个并排文本列的一页响应式 Bootstrap 设计的一部分。设计者希望这两列有一个最大宽度,但一旦达到最大宽度,它就不再居中(因为其余内容继续响应)。

Is there a way around this to still have the two columns of text centered?

有没有办法解决这个问题,仍然让两列文本居中?

Edit: Here is a link to what the code looks like: http://www.bootply.com/119539

编辑:这是代码外观的链接:http: //www.bootply.com/119539

采纳答案by Lokesh Suthar

Here try this Bootply. Is this what you are looking for?

在这里试试这个Bootply。这是你想要的?

<div class="row">
    <div class="col-lg-12">
            <h2 class="center-block">How We Work</h2>

    </div>
    <div class="col-lg-4 col-lg-offset-2">
        <p class="text-justify center-block">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce quis nulla nec lacus condimentum molestie.</p>
    </div>
    <div class="col-lg-4">
        <p class="text-justify center-block">Lorem ipsum dolor sit amet, consectetur adipiscing elit. .</p>
    </div>
</div>


h2.center-block{
    text-align:center;
}

p.text-justify{
 max-width:400px;
}

NOTE:You can use col-lg-offset-2to shift the div by 2 columns.

注意:您可以使用col-lg-offset-2将 div 移动 2 列。