【问题标题】:CSS3Pie margins sets to zeroCSS3Pie 边距设置为零
【发布时间】:2011-09-08 20:00:33
【问题描述】:

我有这样的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

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

【问题讨论】:

    标签: internet-explorer css css3pie


    【解决方案1】:

    这对我有用(我也在派论坛上发布过)- 把它放在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 可以)。 (不知道连接是什么,但它有效)

    【讨论】:

      猜你喜欢
      • 2013-03-24
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      • 2018-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-18
      相关资源
      最近更新 更多