您的位置:首页 > Web前端 > JQuery

使用jquery修改css中带有!important的样式属性

2016-04-27 17:55 746 查看
<div class="test">使用jquery修改css中带有!important的样式属性</div>

外部样式为

div.test{
width:auto !important;
overflow:auto !important
}
通过$("div.test").css("width","100px");和 $("div.test").css("width","100px !important");

要想修改,可通过如下方式:

$("div.test").css("cssText", "width:650px !important;");


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

$("div.test").css("cssText", "width:650px !important;overflow:hidden !important");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: