【问题标题】:How to add negative margin in IE7?如何在 IE7 中添加负边距?
【发布时间】:2013-04-20 13:30:11
【问题描述】:

如何在 IE7 中添加负边距? 我的代码是:

.product-tabs {
    position: relative;
    margin: -40px 0 0 -17px;
}

在所有浏览器中,它的工作方式都像我在 IE7 中一样,我尝试用 top:-40px; left:-17px; 替换边距,但随后块向上移动并在底部留下空白空间。 我还尝试将position: relative 更改为position: absolute,但随后.product-tabs 父div 高度为0。

【问题讨论】:

    标签: html css internet-explorer-7 position margin


    【解决方案1】:

    习惯了

    .product-tabs {
        position: relative;
    
    top:-40px;
    left:-17px;bottom:0;
    }
    

    【讨论】:

    • 我怎样才能摆脱底部的空白空间?
    • 替换相对于绝对位置的位置,如果不是,请用 html 和 css 向我展示您完成的代码
    • 你有没有看我的问题?你是在说我做我已经尝试过的事情。正如我所说,如果我相对于绝对值更改位置,则父 div 高度为 0,所以这不是解决我的问题的好方法。
    猜你喜欢
    • 2011-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-27
    • 2013-04-24
    • 1970-01-01
    • 2011-05-27
    • 2011-08-10
    相关资源
    最近更新 更多