没有显示!重要的是需要使用jQuery覆盖

Sam*_*ath 24 css jquery

谁知道如何使用jQuery覆盖下面提到的CSS?

 .actionButton.single-pet
        {
            display: none !important;
        }
Run Code Online (Sandbox Code Playgroud)

它不适用于此: $('.actionButton.single-pet').show();

wei*_*912 59

$('.actionButton.single-pet').attr("style", "display: inline !important");
Run Code Online (Sandbox Code Playgroud)

将CSS设置为display: inline !important;.display: inline是默认属性display.您需要!important再次覆盖之前的内容!important.

请注意,!important不应经常使用.阅读如何覆盖接受的答案!重要?更多细节.

更新:我们不能.css()在这里使用,因为它不支持!important.http://bugs.jquery.com/ticket/11173了解更多详情; 似乎是一个错误.