Bootstrap xs columns wrap

泪湿孤枕 提交于 2019-11-26 19:13:15

This is a known issue: https://github.com/twbs/bootstrap/issues/13221

At screen widths <360px, the .col-xs-1 columns start to wrap because..

"while the column is set to width: 8.333333%;, the column is going to be at least 30px wide because of the 15px padding on either side. Therefore, there's a mismatch and the browser just stacks the columns" - @mdo

The problem can be avoided by not using col-xs-1 on very small screens. You should also consider if the screen will realistically be resized less than 360px. In most cases it is not.


Note: In Bootstrap 4, col-xs-1 is now col-1.


Related: Bootstrap grid breaks in smallest size

It works well for me. But your code lacks a closing div and few quotation marks.

<div class="container">
 <div class="row">
  <div class="col-xs-2">
  </div>
  <div class="col-xs-1 col-xs-offset-8">
  </div>
  <div class="col-xs-1">
  </div>
 </div>
</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!