CSS3Pie边距设置为零 [英] CSS3Pie margins sets to zero

查看:181
本文介绍了CSS3Pie边距设置为零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的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旧版本中添加圆角接缝,它确实是很酷,但我注意到边缘迷失了。我用谷歌搜索并发现了一些与之相关的链接,看起来背后有一些错误。
http://css3pie.com/forum/viewtopic.php ?f = 3& t = 92 http:// css3pie.com/forum/viewtopic.php?f=3&t=364

The rounded corners seams to be added in all IE old versions, it is really cool, but i noticed that margings getting lost. I googled and found some links related to that, looks like there is some bugs behind that. http://css3pie.com/forum/viewtopic.php?f=3&t=92 and http://css3pie.com/forum/viewtopic.php?f=3&t=364

所以我的问题是 - 什么是更好,更有效的解决方法对于那个?

So and my question is - What is the better and more efficient workaround for that?

推荐答案

这里有一些对我有用的东西(我也在馅饼论坛上发布) -
把它放在body标签后面(如果在标题中不起作用):

Here's something that worked for me (I posted it on the pie forum as well) - Put this right after the body tag (does not work if in the header):

<!--[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中,对于具有底部边距的每个pied元素,添加一个底部边距的表达式语句如下:

Then, in your css, to each "pie"d element that has a bottom margin, add an "expression" statement for the bottom margins like this:

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

无边框元素仍未显示正确的边距可能需要一个边框(类似border-bottom:1px solid transparent;就好了。不要用margin-bottom:-1px来取消它,否则它将无效)。
另外,如果你想要在pie'd元素中出现绝对元素,你仍然需要将pie'd元素中的浮动元素包装在自己的包装器中(普通div会这样做)。 (不知道连接是什么,但它有效)

Borderless elements still not showing correct margins may require a border (something like "border-bottom: 1px solid transparent;" is fine. do not follow it with a "margin-bottom: -1px" to cancel it or it won't work). Also, you will still need to wrap floating elements in the pie'd element in their own wrapper (plain div will do) if you want absolute elements in the pie'd element to appear. (no idea what the connection is, but it works)

这篇关于CSS3Pie边距设置为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆