BlockUI forces all elements to center

我的未来我决定 提交于 2019-12-12 01:05:16

问题


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


回答1:


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' }



回答2:


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.



来源:https://stackoverflow.com/questions/16523066/blockui-forces-all-elements-to-center

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!