删除/重置CSS行为属性 [英] Remove/reset CSS behavior property

查看:143
本文介绍了删除/重置CSS行为属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过更具体的规则或!important 声明删除IE特定的行为CSS属性?示例:

  .a-rule 
{
behavior:url(/some.htc);
}
.a-rule.more-specific
{
行为:/ *无HTC * /
}



我意识到覆盖CSS属性是不受欢迎的,但我被困在这里。



strong>在编辑:我不知道人们对这个问题感到困惑。出于所有目的,您可以考虑这已经是一个特定于IE的样式表。我问如何,如果 .a-rule 上面存在并且是不可变的,如何通过更具体的规则删除行为?一个标准的CSS等效项是:

  .a-rule 
{
border:1px solid black;
}
.a-rule.more-specific
{
border:0 none;
}

可以通过更具体的规则重置元素子集的border属性。我要问如何以类似的方式重置行为属性。

解决方案

默认值为none。请参阅:





解决方案:

  .a-rule 
{
behavior:url(/some.htc);
}
.a-rule.more-specific
{
behavior:none;
}


Is it possible to remove the IE-specific behavior CSS property via a more specific rule or the !important declaration? Example:

.a-rule
{
  behavior: url(/some.htc);
}
.a-rule.more-specific
{
  behavior: /*no HTC*/
}

I realize that overriding CSS properties is undesirable, but I'm stuck here.

On Edit: I'm not sure where people are getting confused about this question. For all purposes, you can consider this already being an IE specific stylesheet. I'm asking how, if .a-rule above exists and is immutable, how can one remove the behavior via a more specific rule? A standard CSS equivalent would be:

.a-rule
{
  border: 1px solid black;
}
.a-rule.more-specific
{
  border: 0 none;
}

One can reset the border property for a subset of elements via a more specific rule. I'm asking how to reset the behavior property in an analogous way.

解决方案

The default value is "none". See:

What is the *correct* way to unset the behavior property in CSS?

The solution:

.a-rule
{
  behavior: url(/some.htc);
}
.a-rule.more-specific
{
  behavior: none;
}

这篇关于删除/重置CSS行为属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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