开发者

JS works in Chrome but not Firefox

开发者 https://www.devze.com 2023-04-12 22:47 出处:网络
I can\'t figure out why this isn\'t working in FF? It does work in Chrome and Firebug doesn\'t show any errors in FF, but it\'s being ignored.

I can't figure out why this isn't working in FF? It does work in Chrome and Firebug doesn't show any errors in FF, but it's being ignored.

$(document).ready(function() {

            $(function(){
                $('#content-left').css({'display': 'block !important', 'width': '80px !important'});
                $('#content-right').css('width', '250px !important');
                $(开发者_StackOverflow中文版'#content-middle').css({'width': '630px !important', 'float': 'left !important', 'height': 'auto !important', 'padding': '0 10px !important'});
            });

        });

Anyone got any ideas? Thanks!


You cannot use !important at inline styles at Firefox.

Besides, you shouldn't use !important UNLESS you've got no other options left.
In your case, !important is unnecessary, because inline styles already have a very high specificity.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号