声明或包含“behavior:url(PIE.htc);”全球

时间:2014-02-13 12:01:07

标签: html css css3

我使用“css3 pie”使我的网站与IE 8兼容

Bellow是css代码,像这样我使用了几个具有各种设计的类。 behavior: url(PIE.htc);在向每个类声明它时起作用,但我应该在css的每个类中声明。我需要知道是否有可能将其声明为全局。

      .content { 
        -webkit-border-radius: 8px;   
        -moz-border-radius: 8px;
        border-radius: 8px;
        -webkit-box-shadow: #666 0px 2px 3px;
        -moz-box-shadow: #666 0px 2px 3px;
        box-shadow: #666 0px 2px 3px;
        background: #EEFF99;
        behavior: url(PIE.htc); //for making IE 8 compatible 

          }.content { 
        -webkit-border-radius: 8px;   
        -moz-border-radius: 8px;
        border-radius: 8px;
        -webkit-box-shadow: #666 0px 2px 3px;
        -moz-box-shadow: #666 0px 2px 3px;
        box-shadow: #666 0px 2px 3px;
        background: #EEFF99;
          }

1 个答案:

答案 0 :(得分:0)

您可以通过执行以下操作来实现此目的:

.content, .otherclass, .someclass {
    behavior: url(PIE.htc);
}

如果您正在使用Sass,您可以执行以下操作:

.cssPie {
    behavior: url(PIE.htc);
}

.myFirstClass {
    @extend .cssPie;
    border-radius: 15px;
}

.mySecondClass {
    @extend .cssPie;
    box-shadow: 0 0 5px #000;
}
相关问题