css - 为什么我的图像行没有跨越完整的 col-md-10 宽度?

标签 css html image row

我有一行图像设置为 col-md-10,但行没有跨越 col-md-10 的整个宽度。它的左右边缘周围有一点填充,我不知道它来自哪里。谁能帮忙?

The edge of the image should align with the edge of the red container below

HTML

<div class="row">
                <div class="col-md-offset-1 col-md-10 col-sm-offset-2 col-ms-8 col-xs-offset-1 col-xs-10">
                    <!--can be overflow row of assets-->
                    <div class="row screensRow1">
                        <%= image_tag 'Screen1.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                        <%= image_tag 'Screen2.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                        <%= image_tag 'Screen3.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-offset-1 col-md-10 col-sm-offset-2 col-ms-8 col-xs-offset-1 col-xs-10">
                    <!--can be overflow row of assets-->
                    <div class="row screensRow2">
                        <%= image_tag 'Screen4.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                        <%= image_tag 'Screen5.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                        <%= image_tag 'Screen6.png', class: 'img-responsive col-md-4 col-sm-6 col-xs-12'%>
                    </div>
                </div>
            </div>
            </div>

CSS

.screensRow1{
    padding-top: 50px;
    padding-bottom: 0px;
}

.screensRow2{
    padding-top: 25px;
    margin-bottom: 100px;
}

最佳答案

来自 Bootstrap Grid system

  • Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.
  • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via
    negative margin on .rows.

关于css - 为什么我的图像行没有跨越完整的 col-md-10 宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40772335/

相关文章:

javascript - 在 WordSmith jquery 中,什么决定了双击后链接图标的位置?

html - 为嵌套列表重置 CSS 计数器,格式为 1.1、1.2、

html - 一切都有位置等......为什么 Z-index 不适合我?

iphone - 如何定位正确的图片路径

jquery - 使用 jquery 加载图像后加载 div

Javascript - 覆盖先前在另一个函数中声明的样式

html - CSS 在 href 悬停时显示子菜单

javascript - 使用不同的参数调用函数两次

javascript - 在 IE9 上对新 Canvas 的第一次绘制图像调用很慢

c - 重复图像检测算法?