简体   繁体   中英

web page different display with localhost and ip address

I am experiencing a strange problem with my website today. I have my local code in aspx , which i can browse perfectly in ie and firefox, I publish it in my computer and create a virtual web site and then browse it with both firefox and ie like http://localhost/testwebsite/default.aspx and it displays also perfectly but when switching from localhost to my local ip address the page displays strange in the element layout, they lay in strange order not like they should.

I am not being able to figure out this problem? Is it some new problem of ie. What is so different when browsing by localhost and ip for the same published code. The only one doubt would be about relative css and javascript paths but we checked them and they appear fine.

Try adding the following meta tag to the head of your page:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

I was having a similar problem with IE8 forcing an intranet site of mine to be viewed in IE7 compatibility mode.

If you have trouble with IE8 forcing an intranet site of mine to be viewed in IE7 compatibility mode. You could also uncheck Tools|Compability View Settings|Display Intranet Sites in Compability View. (This should have been a comment to MarkKBS answer but I got no comment button)

if you are using IE9 press F12 and see the "compatible type" when you run from the IP and "localhost". I was facing the same problem here, the IP was using IE8 compatible mode.

Try using something like Firebug to see that all of your file references are in fact correct. You might be missing some default CSS that is mostly overridden. If you install firebug, you can see that even though you requested a file you are not getting it, plus a whole lot of other stuff that might help in future scenarios.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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