html - Bootstrap div 比手机宽度宽

标签 html css twitter-bootstrap razor twitter-bootstrap-3

所以我有这些比手机宽度 (412px) 还宽的 bootstrap div。为什么? 我该怎么做才能使 div 与手机的宽度一样宽?

enter image description here

    <div class="row">
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: red">
        1234567890-1234567890-1234567890-
    </div>
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: yellow">
        1234567890-1234567890-1234567890-
    </div>
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: blue">
        1234567890-1234567890-1234567890-
    </div>
    </div>

最佳答案

您缺少类 container 作为 bootstrap 的父级,因此请使用:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
  <div class="row">
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: red">
      1234567890-1234567890-1234567890-
    </div>
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: yellow">
      1234567890-1234567890-1234567890-
    </div>
    <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12" style="background: blue">
      1234567890-1234567890-1234567890-
    </div>
  </div>
</div>

编辑

根据您的链接,问题是 body 中的 min-width:600px 您在 CSS 文件中的位置

关于html - Bootstrap div 比手机宽度宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43546645/

相关文章:

css - 找不到 Laravel Bootstrap 文件

javascript - 如果 CMS 的复选框为 true,则切换文本框

css - md-checkbox Angular Material 样式

css - 将彩色不透明度应用于 SVG 图像

html - Bootstrap 折叠移动导航栏不工作

html - Bootstrap list-group-items 与 list-group 容器齐平

html - 使用 Bootstrap 在滚动时动画/缩小 NavBar

javascript - 使用下一个和上一个按钮(如轮播)创建菜单列表

javascript - 当我尝试将其与其他信息一起显示时,我的用户定义变量会删除所有其他信息

javascript - parsley.js 如何使用自定义错误消息在字段上触发错误