【问题标题】:How delete inline-style with inlinecode html + class如何使用 inlinecode html + class 删除内联样式
【发布时间】:2022-07-12 21:57:06
【问题描述】:

如何在我的代码中删除“width:400px”:

<div class="owl-item active" style="width: 400px;">

我没有访问内联代码 :( 我必须解决其他问题

请帮忙。

【问题讨论】:

  • 你不能改变它来自owl-carouseljavascript

标签: html jquery css


【解决方案1】:

创建一个覆盖内联样式的更具体的规则,例如

.owl-item.active {
  width: initial !important; /* or auto */
}

.owl-item.active {
  border: 1px #ccc solid;
  width: initial !important;
}
&lt;div class="owl-item active" style="width: 400px;"&gt;div&lt;/div&gt;

【讨论】:

  • 覆盖默认行为 css 是一种好习惯吗?来自这个owl-carousel CSS?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-24
  • 2012-10-11
  • 2011-01-30
  • 2012-10-09
  • 2014-03-15
  • 2012-07-13
相关资源
最近更新 更多