我有一个如下定义的 div:
<div style="background-color: rgb(217, 240, 211) ! important; color: rgb(0, 102, 2) ! important;" class="div_box">... ...
</div>
由于该div当前正在使用内联样式(我讨厌这个!),因此我需要覆盖背景颜色以及颜色。
我尝试过:
.div_box[style] {
background-color: rgb(216, 219, 215) ! important;
color: rgb(94, 94, 94) ! important;
}
但是它没有生效。我还尝试过使用".div_box { ... }",但仍然不起作用。
所以我的问题是,如何在不手动更改内联样式的情况下覆盖上述div样式?