简体   繁体   English

如何对JavaScript警报进行文本对齐?

[英]How to text-align right a javascript ALERT?

I am trying to right align some text in a javascript alert box. 我正在尝试在javascript警报框中右对齐一些文本。 It is an Israeli client so the context is in hebrew and should be right aligned. 它是以色列的客户,因此上下文是希伯来语,应该正确对齐。

alert("הצעת חוק פרטית לאסור על\n מוסדות המדינה לשלם לספקים תמורת טובין ושירותים בתשלומים דחויים");

It does look ok in FireFox and Chrome, but not in IE9. 在FireFox和Chrome中看起来确实可以,但是在IE9中却没有。

ideas? 想法?

Use some alternative javascript alerts like Impromptu or similar. 使用一些备用的JavaScript警报,例如Impromptu或类似警报。 Its style can easily be configured to suite your needs and most of them are cross-browser compatible. 可以轻松配置其样式以适合您的需求,并且大多数样式都与跨浏览器兼容。

If you are using a version of IE9 which is in a language that is based on right aligned text, the text will be right-aligned in IE9 (native) windows. 如果您使用的IE9版本使用的语言是基于右对齐文本的,则该文本将在IE9(本机)窗口中右对齐。 Are you sure you're testing with a hebrew version of IE9? 您确定要使用希伯来语版本的IE9进行测试吗? Keep in mind, unlike FF and Chrome, IE9 UI language == Windows language. 请记住,与FF和Chrome不同,IE9 UI语言== Windows语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM