【问题标题】:Why the developers use negative margin when they float items?为什么开发人员在浮动项目时使用负边距?
【发布时间】:2013-03-31 01:10:34
【问题描述】:

如果我浮动项目,为什么要使用负边距?

ul {
{negative margin}
}

ul li {
float:left;
margin-right:10px;
}

我在哪里看到过,但我不记得了。你能解释一下为什么他们使用负边距属性吗?我在 wordpress 的 211 主题中看到了同样奇怪的东西。

【问题讨论】:

标签: css wordpress margin


【解决方案1】:

边距中的负值与正值具有相同的目标。这只是演示。

由于@better_use_mkstemp 链接到您,W3C 允许负值;那么你就不能认为它是“奇怪的”。

cf:http://coding.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/

【讨论】:

    猜你喜欢
    • 2012-05-09
    • 1970-01-01
    • 2010-12-22
    • 2016-05-22
    • 1970-01-01
    • 2015-06-29
    • 2011-04-04
    • 2012-02-15
    • 2013-02-17
    相关资源
    最近更新 更多