0

我正在尝试让 css3pie 不在 ie7 中运行某个类。我正在使用 HTML5 Boilerplate 为我提供 IE 特定的类来使用。我一直在尝试做的是这个

.ie7 .classname {
 position: absolute;
 background: #000;
}
.classname {
  css3pie: stuff;
  position: relative
  background: #fff;
}

但这似乎不起作用,css3pie 仍在处理中。

有谁知道我还能尝试不让 css3pie 修复程序运行吗?

4

3 回答 3

1

如果您使用的是 PIE ( pie.htc) 的 DHTML 行为版本,请仅在您想要的元素上声明行为。就我而言,我有一个pie类,我将它添加到需要饼图的元素中,然后像这样声明我的 CSS:

.pie { behavior: url(pie.htc); }

在你的情况下,你可以这样做:

.ie6 .pie, .ie8 .pie, .ie9 .pie { behavior: url(pie.htc); }

或者调整样板条件注释以.ienot7在 IE 6、8 和 9 中添加一个类:

<!--[if lt IE 7 ]> <html class="ie6 ienot7"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8 ienot7"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie9 ienot7"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
.ienot7 .pie { behavior: url(pie.htc); }
于 2011-10-21T14:47:27.480 回答
0

仅在 IE7 中设置behavior: ''。例如:

.classname {
    behavior: url(pie.htc);
}
.ie7 .classname {
    behavior: '';
}

这很好,因为不需要更改 HTML。

于 2011-10-21T15:56:46.703 回答
0

我的印象是您必须明确地将 css3pie 应用于您希望它处理的声明,如下所示:

.border-radius-5 {
    -webkit-border-radius : 5px;
    -moz-border-radius : 5px;
    border-radius : 5px;
    position:relative;
    behavior: url(/css/PIE.htc);
} 
于 2011-10-21T14:45:35.487 回答