CSS在Web服务器上的呈现方式与开发环境不同 [英] CSS renders differently on web server than on development environment

查看:119
本文介绍了CSS在Web服务器上的呈现方式与开发环境不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题,其中我在我的开发环境中创建的Web应用程序在我上传到Web服务器后显示不同。

I have this problem where the web application that I have created in my development environment, displays differently after I upload it to the web server.

我使用相同的浏览器和同一台机器查看页面。唯一不同的是,服务器。我使用.net 3.5和在我的开发环境的页面是使用ASP.net开发服务器。在Web服务器上,使用IIS 6.0提供页面。

I am using the same browser and the same machine to view the pages. The only thing different, is the "server". I am using .net 3.5 and on my development environment the pages are served using the ASP.net Development Server. On the web server, the pages are served using IIS 6.0.

我只有一个CSS文件包含在App_Themes / Default文件夹中,用于控制我应用程序中的所有CSS。

I have only a single CSS file that is contained within the "App_Themes/Default" folder that is used to control all the CSS in my application.

这里有一些不显示相同的东西:

Here are some of the things that don't display the same:

1)我有一个可折叠的面板控件,当展开时应显示在所有其他页面元素的顶部。在开发环境中,它的行为正确。在网络服务器上,面板滑动到其他元素下面。

1) I have a collapsible panel control that when expanded is supposed to show on top of all the other page elements. On the dev environment, it behaves correctly. On the web server, the panel slides underneath the other elements.

2)我的元素定义了背景和一定的字体大小。当显示在我的开发环境中时,文本显示在一行上。但是,在Web服务器上,即使文本大小相同,文本也会包装。就像包含div以某种方式呈现为更小。

2) I have my element defined with a background and a certain font size. When displayed on my development environment, the text displays on one line. However, on the web server, the text is wrapped even though the text is the same size. It's as if the containing div is somehow rendered "smaller".

3)没有固定宽度的按钮的宽度(因此宽度由按钮决定文本)在开发环境和Web服务器之间是不同的。

3) The width of buttons that do not have a fixed width (so the width is determined by the button text) is different between the development environment and the web server. The bottons on the server are always wider.

我检查以确保没有引用其他CSS元素在machine.config和服务器上的全局web.config和我的开发环境。

I checked to make sure there are no references to other CSS elements in the machine.config and global web.config on the server and on my development environment.

我知道服务器正在从CSS读取,因为一般来说,它看起来类似(相同的颜色,背景,字体样式等)。

I know the server is reading from the CSS because in general, it looks similar (same colors, backgrounds, font style, etc). It's just that the sizes seems to be off and the layering of the divs.

之前有人遇到过这个问题吗?

Has anyone run in to this problem before? Any ideas of what I could look for?

推荐答案

看起来你正在Internet Explorer 8中比较它们。微软引入了不同的渲染模式

Looks like you are comparing them in Internet Explorer 8. Microsoft introduced different rendering modes for local and Internet servers so that web developers would break down in tears.


如果没有与X-UA兼容的值,并且网站位于
本地Intranet安全区域,默认情况下将在EmulateIE7模式下呈现

If there’s no X-UA-Compatible value and site is in Local Intranet security zone, it will be rendered in EmulateIE7 mode by default.

添加X-UA -

另请参阅 http://sharovatov.wordpress.com/2009/05/18/ie8-rendering-modes-theory-and-practice/ < a>

See also http://sharovatov.wordpress.com/2009/05/18/ie8-rendering-modes-theory-and-practice/

这篇关于CSS在Web服务器上的呈现方式与开发环境不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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