MVC 3 和 RTL - IE9 问题
我一直在使用一个非常简单的 ASP.Net MVC3 项目来试验字符串和 RTL 的本地化。我有一个看起来像这样的视图:
@model LocalizationExample.Models.HomeModel
@using Microsoft.License.Ux.Partner.LanguageResources.Order;
@{
ViewBag.Title = "Index";
}
<h2>@OrderResource.PageTitle</h2>
<div dir="rtl">
@Html.LabelFor(x => x.Field1) @Html.TextBoxFor(x => x.Field1)<br />
@Html.LabelFor(x => x.Field2) @Html.TextBoxFor(x => x.Field2)<br />
@Html.LabelFor(x => x.Field3) @Html.TextBoxFor(x => x.Field3)<br />
</div>
In FireFox 10 & Chrome 17 中,这会产生三行文本框,标签位于右侧 - 全部在浏览器的右侧对齐。
在 IE9 中,前两个文本框的标签位于左侧,最后一个文本框的标签位于右侧 - 所有文本框都在浏览器的右侧对齐。
我尝试将“dir”移动到 body 标记以及 html 标记,但得到了相同的结果。我怎样才能让它在 IE9 中正确显示?
提前致谢!
I've been working with a very simple ASP.Net MVC3 project to experiment with localization of strings and RTL. I have a view that looks like this:
@model LocalizationExample.Models.HomeModel
@using Microsoft.License.Ux.Partner.LanguageResources.Order;
@{
ViewBag.Title = "Index";
}
<h2>@OrderResource.PageTitle</h2>
<div dir="rtl">
@Html.LabelFor(x => x.Field1) @Html.TextBoxFor(x => x.Field1)<br />
@Html.LabelFor(x => x.Field2) @Html.TextBoxFor(x => x.Field2)<br />
@Html.LabelFor(x => x.Field3) @Html.TextBoxFor(x => x.Field3)<br />
</div>
In FireFox 10 & Chrome 17, this results in three rows of TextBox's with the Labels on the right - all aligned on the right side of the browser.
In IE9, the first two textboxes have the labels to the left and the last textbox has the label to the right - all are aligned on the right side of the browser.
I've tried moving the "dir" up to the body tag and also to the html tag, but I get the same result. How can I get this to display correctly in IE9?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将它们嵌套在 div 内,它们似乎会正确对齐:
They seem to align properly if you nest them inside divs: