jquery动态修改带有important的样式方法

$('.el-card').css("background", "#fff !important");(不起作用的)

改为:

$('.el-card').css("cssText", "background-color:#fff !important;");

要想修改多个属性,可通过如下方式:

$(".el-card").css("cssText", "width:650px !important;overflow:hidden !important");
posted @ 2019-07-19 16:01  sweeeper  阅读(1407)  评论(0编辑  收藏  举报