【问题标题】:IE8 PIE.htc and background-color together not workingIE8 PIE.htc 和背景颜色一起不起作用
【发布时间】:2012-10-25 06:04:59
【问题描述】:

我已经尝试过 PIE.htc 和 background-color 一起使用,但圆角在 IE8 中不起作用。 我的css如下。

#main{

     background-color: #CD0D00 !important; 
     -webkit-border-radius: 15px 15px 15px 15px; 
     -moz-border-radius: 15px 15px 15px 15px; 
     border-radius: 15px 15px 15px 15px; 
     behavior: url(PIE.htc);
     -webkit-box-shadow: 0 7px 10px rgba(0,0,0,0.3); 
     -moz-box-shadow: 0 7px 10px rgba(0,0,0,0.3); 
     box-shadow: 0 7px 10px rgba(0,0,0,0.3);

}

注意:当我从背景颜色中删除“!important”时,颜色不会出现,但圆角在 IE8 中有效,否则不会。

【问题讨论】:

标签: internet-explorer-8 rounded-corners css3pie


【解决方案1】:

嗯,众所周知,使用!important 会导致 CSS3Pie 出现问题,所以这并不奇怪。

至于 background-color 本身没有 !important,我不确定为什么它不起作用,但有一些建议:

  • 尝试改用简写background 样式——即background:#CD0D00;。对于大多数事情,CSS3Pie 倾向于使用简写样式。

  • 对于某些background 属性,CSS3Pie 无法在标准background 样式中支持它们;它需要一个自定义的-pie-background 样式。理论上,这仅适用于高级背景属性,基本背景颜色不需要,但值得尝试。

我目前手头没有 IE 副本来试用它,但希望能有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-17
    • 2021-08-16
    • 1970-01-01
    • 1970-01-01
    • 2014-04-09
    • 2016-06-11
    • 2012-02-20
    • 2012-07-11
    相关资源
    最近更新 更多