你好,我正在使用 jquery
我想将具有重要属性
的CSS颜色添加到标签
我正在尝试
jQuery(this).css('color','green !important')
不使用类
喜欢
label_class
{
background-color:#f2f2f2 !important;
}
并使用类似的
jQuery(this).addClass('label_class');
我可以只使用 jquery 来做这个吗,请帮忙
最佳答案
是的,这并不难,但您应该尽量避免一直使用 !important。
$("#tabs").css("cssText", "height: 650px !important;");
这是类似问题的链接 How to include !important in jquery
希望这有帮助:)
关于javascript - 我可以用 !important 添加 css 吗,只使用 jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11773276/