0

我有这样的CSS

.corner-wrapper
{
    display:table;
    position:relative;
    border: 2px solid #69b0ff;  
    margin:5px 0 5px 0;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    behavior: url("PIE.htc");   
}

在所有 IE 旧版本中添加圆角接缝,这真的很酷,但我注意到margings 丢失了。我用谷歌搜索并找到了一些与此相关的链接,看起来背后有一些错误。 http://css3pie.com/forum/viewtopic.php?f=3&t=92http://css3pie.com/forum/viewtopic.php?f=3&t=364

所以我的问题是 - 什么是更好和更有效的解决方法?

4

1 回答 1

2

这是对我有用的东西(我也在 pie 论坛上发布了它) - 把它放在 body 标记之后(如果在标题中不起作用):

<!--[if lte IE 7]>
<script type='text/javascript'>
document.body.onload = function(){
 document.body.style.zoom = '2';
 document.body.style.zoom = '1';
}
</script>
<![endif]-->

然后,在您的 css 中,对于每个具有底部边距的“pie”d 元素,为底部边距添加一个“表达式”语句,如下所示:

.my_div {margin-bottom: 10px; margin-bottom: expression('10px');}

仍然没有显示正确边距的无边框元素可能需要一个边框(类似于“border-bottom: 1px solid transparent;”很好。不要在它后面加上“margin-bottom:-1px”来取消它,否则它将不起作用)。此外,如果您希望 pie'd 元素中的绝对元素出现,您仍然需要将 pie'd 元素中的浮动元素包装在它们自己的包装器中(普通 div 可以)。(不知道连接是什么,但它有效)

于 2011-11-18T11:00:44.200 回答