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

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

改为:

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

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

$(".el-card").css("cssText", "650px !important;overflow:hidden !important");
原文地址:https://www.cnblogs.com/sweeeper/p/11213830.html