在上传到网络服务器后,布局损坏 [英] Layout is broken after uploading to web server

查看:96
本文介绍了在上传到网络服务器后,布局损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个小网站(100%css布局)。我已经测试了它在IE,Firefox和它看起来不错。
当我上传到我的托管公司网络服务器布局是破碎只有在互联网浏览器。我的意思是css被正确加载,但一些元素不在他们的地方。



例如

pre> #main {
position:relative;
width:960px;
margin:0 auto;
}

上面的代码将#main div放在屏幕中央。在我的电脑上,它在IE,Firefox等工作正常。但在网络服务器上div漂浮在左边的IE



可能出错?

解决方案

Internet Explorer有许多用于确定文档呈现模式的东西。



添加

 < meta http-equiv =X-UA-Compatiblecontent =IE = edge> 

然后检查文档是否一致如果是这样,那确认问题是什么,你只需要修复CSS以最佳标准模式使用IE。



Microsoft提供更多详细信息



此外,请确保您未使用工具栏上的兼容性按钮强制与旧的,buggier版本的IE兼容。


I developed a small site (100% css layout). I have tested it on IE, Firefox and it looks fine. After I upload it on my hosting company web server layout is broken only on internet explorer. I mean css is loaded properly but some elements are not at their places. I checked several times the css files on my local pc and the webserver and they have same content.

For example

#main{
    position: relative;
    width: 960px;
    margin: 0 auto;
}

The code above puts #main div at the center of the screen. On my pc it work fine on IE, Firefox etc. But on web server that div floats to left on IE

What could be wrong ?

解决方案

Internet Explorer has a number of things it uses to determine document rendering mode. The document being local or on the Internet is one of them.

Add

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

And then check the documents are consistent (either broken in both or working in both). If so, that confirms what the problem is and you just need to fix the CSS to work with IE in its best standards mode.

Microsoft provide more details.

Also make sure you aren't using the Compatibility button on the toolbar to force compatibility with older, buggier versions of IE.

这篇关于在上传到网络服务器后,布局损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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