Bootstrap中.row类的负左右边界 [英] Negative left and right margin of .row class in Bootstrap

查看:42
本文介绍了Bootstrap中.row类的负左右边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于好奇,为什么引导程序会使用 -15px 左右 margin 来取消 15px 左右 .container 和 .container-fluid 类上> padding .
为什么要设置填充,然后在孩子身上以负边距取消填充?

Just out of curiosity, why bootstrap uses -15px left and right margins which going to cancel the 15px left and right padding on .container and .container-fluid classes.
Why set padding and then cancel it with a negative margin on the child?

推荐答案

行上的负页边距避免了由于第一列的填充而留下的空白.如果没有它,整个布局看起来会有些缩进.

A negative margin on row avoids the blank space that would be left because of padding of first column. In its absence the whole layout will look a little indented.

这篇关于Bootstrap中.row类的负左右边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆