BlockUI forces all elements to center

2019-08-27 19:31发布

How can I re-force my elements back to left align as jquery blockui plugin is forcing them to center,

I tried this so far,

$.blockUI({ message: $('#popup'), css: { text-align: 'left' } });

http://www.malsup.com/jquery/block/#demos

2条回答
狗以群分
2楼-- · 2019-08-27 19:36

Using the CSS hack !important should do the trick. Into your CSS file add

#popup{
    text-align:left!important
}

As this should override any other CSS rules imposed upon that element (unless, of course, there are other CSS rules targeting this element also using the !important hack.

查看更多
疯言疯语
3楼-- · 2019-08-27 19:42

You should use camelCase synthax maybe it's just enough:

$.blockUI({ message: $('#popup'), css: { textAlign: 'left' } });

Or using quotes:

$.blockUI({ message: $('#popup'), css: { "text-align": 'left' } });

Maybe you would have to force it using !important

css: { textAlign: 'left !important' }
查看更多
登录 后发表回答