为什么即使使用相同的CSS也会有不同的结果?

为什么即使使用相同的CSS也会有不同的结果?

问题描述:

I copied a PHP web system which made 10 years ago on Linux to my windows PC.

I installed PHP 5.6.2 on my windows PC And It is higher than installed Linux. (old system's PHP is 5.1.4)

But when i compared two web site, they were different a little.

This is the old php in Linux system. enter image description here

And this is new system. enter image description here

Do you know difference? The old system's text of menu aligned to center.

But new system's aligned right a little from center.

So i checked css, But these css are same.

somebody know about this?

我将10年前在Linux上制作的PHP网络系统复制到我的Windows PC上。 p>

我在我的Windows PC上安装了PHP 5.6.2它比安装的Linux更高。 (旧系统的PHP是5.1.4) p>

但当我比较两个时 网站,它们有点不同。 p>

这是Linux系统中的旧版本。 p> \ n

这是一个新系统。 p>

您知道区别吗? 旧系统的菜单文本与中心对齐 。 p>

但新系统与中心略有对齐。 p>

所以我检查了css,但这些css是相同的。 p>

有人知道这件事吗? p> div>

Assuming you have the same HTML DOM, CSS and running the two system on the same browser, browser version and browser compatibility mode..

Have you checked if they are having the same values for the following?

  • HTML doctype
  • X-UA-Compatibility meta type

What the browser renders is the HTML/CSS/Javascript generated by the PHP web server, so the first thing you should check is if the code that's behind those two pages is exactly the same.

If that's the case, you can increase the consistency across different browsers by adding a reset css before the first stylesheet you use. This will reduce the differences in the default browsers's behaviour regarding the style.

I have often used Meyer's reset css, but I know there are newer versions of it and probably some different ones.

I perceived that i had understood one. I'm testing same version IE browser. So i though two site shown up same as same ver.

But old site's document mode was IE5, and new site's edge.

And it was the reason of difference.

Thank you for many comment.