【问题标题】:margin-bottom not working on divs边距底部不适用于 div
【发布时间】:2014-08-08 00:20:25
【问题描述】:

谁能帮我弄清楚为什么我的移动视图媒体查询中的边距底部规则不起作用?

我什至添加了一个类来清除名为.clearer 的浮点数,但这也不起作用。我想要的只是左图在移动视图下方有 30px 的边距。

这是页面...http://www.haveaseatrentals.com/seat-yourself/

来自移动视图的媒体查询的 CSS 规则以及我用来清除浮动的规则...

#seatYourselfLeft {margin-bottom: 30px; }
.clearer{clear:both; width:100%; height:0; display: block;}

非常感谢任何帮助。

【问题讨论】:

    标签: html css floating margins


    【解决方案1】:

    将图像容器的 CSS 更改为 display: inline-block; 而不是 display: inline;

    这个问题之前有人问过,这里已经回答了:https://stackoverflow.com/a/8782644/3781678

    【讨论】:

    • @AlexWilliams 它在您的网站上对我有用!您需要将 margin-bottom: 30px; 添加到 #seatYourselfLeft,这在您的网站上不存在。
    猜你喜欢
    • 2011-08-03
    • 2015-02-03
    • 2017-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-17
    相关资源
    最近更新 更多