UI格式化在IE上使用IP地址而不是localhost时 [英] UI formatting messed up on IE when using IP address instead of localhost

查看:82
本文介绍了UI格式化在IE上使用IP地址而不是localhost时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序使用Primefaces 2.2.1和JSF 2.0,部署在Glassfish 3.1本地机器上。



问题是,当我访问应用程序使用 http:// localhost:8080 / MyApp ,UI格式化很好。但是如果我在URL中使用 http:// ip-address:8080 / MyApp 而不是localhost访问应用程序,UI格式化是有点乱。



这个问题只发生在IE(我有8.0版本),而不是FF。在URL中使用 localhost:8080 ip-address:8080 有什么区别?以下是说明我的问题的照片。



使用 http:// ip-address:8080 / MyApp



>






使用 http:// localhost:8080 / MyApp



>


$ b

使用本地(内部网)的IP地址会强制IE在中运行 http://en.wikipedia.org/wiki/Quirks_mode =nofollow noreferrer> quirks模式,这反过来暴露了 IE框模型bug ,你现在看到了。 IE框模型错误错误地计算填充和边框大小作为宽度的一部分。
在IE中访问网站时不要使用本地IP地址。




I have an application developed using Primefaces 2.2.1 and JSF 2.0, deployed on Glassfish 3.1 local machine.

Problem is that when I access the application using http://localhost:8080/MyApp, the UI formatting is fine. But if I access the application using http://ip-address:8080/MyApp instead of localhost in the url, the UI formatting is kind of messed up.

This problem occurs only on IE (I have version 8.0), not on FF. What's the difference between using localhost:8080 and ip-address:8080 in the url? Following are the pictures that illustrate my problem.

Using http://ip-address:8080/MyApp:


Using http://localhost:8080/MyApp:

Thank you.

解决方案

Using a local (intranet) IP address forces IE to run in quirks mode which in turn exposes among others the IE box model bug, which you're seeing now. The IE box model bug incorrectly calculates the padding and border size as part of width. Just don't use local IP addresses when accessing a site in IE.

这篇关于UI格式化在IE上使用IP地址而不是localhost时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆