Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在Bootstrap3上,为什么会存在这种差距?_Css - Fatal编程技术网

Css 在Bootstrap3上,为什么会存在这种差距?

Css 在Bootstrap3上,为什么会存在这种差距?,css,Css,我做了一个div-col-,在div-col- 这是我的密码 <body style="overflow-y:scroll;"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 text-center" style="bac

我做了一个div-col-,在div-col-

这是我的密码

<body style="overflow-y:scroll;">
<div class="container">
   <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 text-center" style="background-color: darkgray; height: 50px;">
            <p style="word-break: break-all"><h6></h6></p>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 text-center" style="background-color: transparent; height: auto;">
            <div class="col-lg-4 col-md-4 col-sm-4" style="background-color: #003366; height: 40px;">
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4" style="background-color: #447e9b; height: 40px;">
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4" style="background-color: #ba2121; height: 40px;">
            </div>
        </div>
    </div>
</div>
</body>

它有这样的余量

我怎样才能去掉那个边距

我想这就是为什么在第8列中有3列,第4列,而第8列不是等分的

所以我把4列,3列,换成了8列。但同样的结果出来了

利润来自哪里


如何处理这些边距?

因为嵌套了3个
.col-*
.col-*
中有一个填充。一般来说,您应该将
.col-*
类嵌套在
.row
.row
.col-*
类上创建负的左/右
边距
,该边距偏移左/右边
填充
s



我猜透明div有一个填充。@Seblor为什么?在bootstrap中,所有div class=“col--”都有填充?让我快速检查一下。我在JSFIDLE中运行了您的代码,但结果与您不同:@Seblor,谢谢您的建议谢谢您真诚的回答