问题:

浏览器F12看到是这个样子。

!important:element.style 覆盖样式问题

但是我设置的样式是这样子。

#iframe_close
{
    width:750px; 
}

无论怎么设置样式,都无法覆盖掉element.style的样式,width一直都是0。

解决方案:

#iframe_close
{
    width:750px !important; 
}

在想要设置的地方,添加一段!important即可。 !important作用是提高指定CSS样式规则的应用优先权。使该条样式属性声明具有最高优先级。

 


相关文章:Css中!important的用法

相关文章:

  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2021-12-22
  • 2021-11-14
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2021-08-31
  • 2021-08-12
  • 2021-10-07
相关资源
相似解决方案