Windows 7呈现的网页不同于XP或Vista [英] Windows 7 rendering web pages differently than XP or Vista
问题描述
由于切换到Windows 7,我们注意到我们的几个网页有轻微的差异。它主要在查看表单元素(文本输入和提交按钮)时显示。它们稍大/略小几个像素。这似乎是与浏览器无关的 - 我们在Windows 7中使用IE8,FF3.5和Chrome时遇到相同的渲染问题。在Windows Vista环境中切换到相同的浏览器时,问题消失。
Since switching to Windows 7, we've noticed that several of our web pages have slight differences. It mostly shows when looking at form elements (text inputs & submit buttons). They are slightly larger/smaller by a few pixels. This seems to be browser independent - we get the same rendering issues using IE8, FF3.5, and Chrome in Windows 7. When switching to the same browser in a Windows Vista environment, the issue disappears.
发生了什么事?为什么操作系统会影响HTML / CSS元素?
What's going on? Why would an OS affect HTML/CSS elements? Am I missing something very obvious here or is something strange going on?
这里有一个具体的例子:
Here's a specific example:
<input id="input-search" type="text" name="thesearch" value="" />
<button id="btn-search" type="submit" name="search">Search</button>
CSS:
#input-search {
float:left;
font-size:18px;
color:#5b5b5b;
margin:2px 4px 0 0;
width:200px;
}
#btn-search {
background:url(/images/btn_search.png) no-repeat top left transparent;
padding:5px 0px 6px 20px;
}
推荐答案
默认按钮受Windows主题。你会注意到,如果你在经典Windows和银色主题之间切换,即使在Windows XP中,例如,你的按钮改变。你可以通过使用CSS来设置按钮的样式来解决这个问题。
Default buttons are affected by Windows Themes. You'll notice your buttons change if you switch between "classic" Windows and the "Silver" theme even within Windows XP, for example. You can get around this by using CSS to style the buttons.
这篇关于Windows 7呈现的网页不同于XP或Vista的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!