在我的站点中,我正在使用Jquery/Javascript更改DIV的样式。同样的DIV风格后来被第三方js库改变了。是否有办法避免第三方风格的改变。我不允许使用CSS覆盖,因为CSS也是由不同的源编写的。
发布于 2015-09-02 10:43:40
// your css
//// here use id and !important(hack)
#id1{
color: blue !important;
}
// third party css class
.class1{
color: red;
}
// your element
<input type="text" class="class1" id="id1"/>输出:颜色将是蓝色。你的css会赢的。
阅读更多关于css的特性,以更好地理解。
注意: Id比类更具体。
https://stackoverflow.com/questions/32350526
复制相似问题