javascript - 如何防止我的边距崩溃?

标签 javascript html twitter-bootstrap css

问题:

我有两个具有相同 css 的 div,但出于某种原因,第一个 div 得到留有边距,但第二个 没有

enter image description here

Fiddle here

代码: 我正在使用 bootstrap,但除此之外,我还有这两个 css 规则可以给我所需的边距。

.main {
    padding-right: 40px;
    padding-left: 40px;
}

.marginLeftM {
    margin-left: 30px
}

我知道边距正在崩溃,但我不知道如何解决。

最佳答案

您的第一个 div 有额外的边距,所以请添加 CSS。

.marginLeftM {
 margin-left: 30px;
 clear: both;
 }

关于javascript - 如何防止我的边距崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53499054/

相关文章:

Javascript-通过函数和函数参数设置 DIV 的背景图像

html - 如何忽略 parent 的div中心位置

html - 如何在栏的左侧和栏外显示进度条的百分比? Bootstrap 进度条

css - 使用 Bootstrap 时如何取消锚定样式

javascript - 使用 cookie 插件从图像点击触发复选框点击

javascript - 使用 Rickshaw JS 库在 X 轴上显示自定义标签

php - 是否有像 Google 提供网站图标这样的网站提供 apple-touch-icon 的服务?

javascript - 使用 angularjs 时轮播不工作?

javascript - 如何动态更改类 css 样式?

javascript - React Datepicker 不会缩小到父容器