How to override css containing '!important' using jquery?

前端 未结 15 657
清歌不尽
清歌不尽 2020-12-29 21:05

I want to apply height for specific div using jquery but not able to override the \'!important\' keyword using jquery.

Here is

15条回答
  •  失恋的感觉
    2020-12-29 21:15

    First Id is unique identifier, therefore you don't need to search div by it's class name. therefore you can filter div by it's id.

    Try following code

    first add new Class property below myClass like this

    
    

    it will override height property of myClass

    now just add this class to div

    $('#divL3').addClass('testClass');
    

    but making height "0" wont hide content of "divL3". you rather try to hide overflow content or hide entire div by adding css property display:none

    hope it will work for you.

提交回复
热议问题