How to apply !important using .css()?

后端 未结 30 2991
情深已故
情深已故 2020-11-21 07:06

I am having trouble applying a style that is !important. I’ve tried:

$(\"#elem\").css(\"width\", \"100px          


        
30条回答
  •  天涯浪人
    2020-11-21 07:34

    An alternative way to append style in head:

    $('head').append('');
    

    This appends style after all your CSS files so it will have higher priority than other CSS files and will be applied.

提交回复
热议问题