开发者

JS works in Chrome but not Firefox

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜