bootstrap responsive div display

喜夏-厌秋 提交于 2019-12-25 10:00:06

问题


I have two divs

<div class="container">
<div class="span6">
</div>
<div class="span6">
</div>
</div>

When the user uses mobile phone, the divs should be two rows one column instead of two columns one row.

How do I do that ?


回答1:


From Bootstrap docs:

Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">

Also, use proper markup (.spanX should be inside .row):

<div class="container">
  <div class="row">
    <div class="span6"></div>
    <div class="span6"></div>
  </div>
</div>

For fluid layout you may use .container-fluid and .row-fluid.



来源:https://stackoverflow.com/questions/18962700/bootstrap-responsive-div-display

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