Remove/reset CSS behavior property

后端 未结 3 1673
天命终不由人
天命终不由人 2021-01-07 16:18

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

.a-rule
{
  beha         


        
相关标签:
3条回答
  • 2021-01-07 17:03

    Maybe use conditional tags for IE in your head

    <!--[if IE]>
    <style type="text/css">
        .a-rule {
           behavior: url(/some.htc);
        }
    </style>
    <![endif]-->
    
    0 讨论(0)
  • 2021-01-07 17:08

    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;
    }
    
    0 讨论(0)
  • 2021-01-07 17:15
    .a_rule {
      border: 1px solid black; /* we know border is black */
      behavior: url(/some.htc) /* we know something happen inside some.htc */
    }
     .a_rule.more-specific {
      border: 0 none; /* we remove the border */
      behavior: url(/some.htc) /* we remove something inside some.htc */
    }
    

    use different .htc file

    0 讨论(0)
提交回复
热议问题