Bootstrap max-width columns responsive

痴心易碎 提交于 2019-12-22 07:42:24

问题


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).

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


回答1:


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

<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-2 to shift the div by 2 columns.



来源:https://stackoverflow.com/questions/22233766/bootstrap-max-width-columns-responsive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!