gpt4 book ai didi

html - Internet Explorer 中的模糊文本

转载 作者:技术小花猫 更新时间:2023-10-29 11:48:01 24 4
gpt4 key购买 nike

在我的网站上,我注意到 Firefox、Chrome 和 Internet Explorer 之间的文本质量存在显着差异。虽然文本在 Chrome 中非常清晰,在 Firefox 中更是如此,但在 Internet Explorer 中却显得模糊不清。下面是图片对比:

Screenshot comparison of Firefox and IE

个人认为不美观。我想在不要求用户使用 Microsoft Silverlight 等插件的情况下找到解决方案,因为并非所有用户都希望安装插件只是为了查看 1 个网站。我不明白像 Facebook 和 StackOverflow 这样的网站怎么没有这个问题(或者至少没有那么大的问题)。

我尝试过使用 CSS 过滤器、不同的字体渲染属性以及对字体大小使用不同的单位,但我没有看到任何效果。我知道我还没有尝试过所有可能的 CSS 属性组合,所以这仍然是答案。

我已经在网络和 StackOverflow 上搜索了几个小时,但还没有找到解决方案。这里还有其他类似的问题,但仍未得到解答。

非常欢迎任何帮助,或关于去哪里或做什么的想法。如果看不到图像或网站,请在不同的浏览器中运行此代码段:

html,body{
margin:0;
height:100%;
font: normal 14px/24px "Lucida Sans Unicode","Lucida Grande", "Arial", sans-serif;
}
.popup{
position:relative;
top:50%;
left:50%;
text-align: center;
vertical-align: middle;
display: inline-block;
white-space: nowrap;
background-color:rgb(28, 31, 37);
color:white;
padding:1em;
z-index:2;
transform: translate(-50%,-50%);

-webkit-box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 14px -2px rgba(0,0,0,0.75);
}
p{
font-size: small;
}
input{
padding: 16px 12px;
width: 250px;
border: 0;
background: #0A0A0A;
color: #eee;
font-size: 14px;
font-family: "Open Sans",sans-serif;
-webkit-box-shadow: inset 0 0 0 1px #323742;
-moz-box-shadow: inset 0 0 0 1px #323742;
box-shadow: inset 0 0 0 1px #323742;
}
#blackout {
background: rgba(17,19,23,.5);
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1;
cursor: pointer;
}
<div id="blackout"></div>
<div class="popup">
<h1>Compare this text</h1>
<p>And this text as well</p>
<input type="text" placeholder="Even placeholders are blurry">
</div>

奇怪的是,代码片段在不同的浏览器中看起来很相似:但仔细观察还是有明显的区别。 Chrome(版本 44.0.2403.125 m)似乎有锐边效果。 IE (11) 似乎有点模糊。而 Firefox (38.0.1),正如@user4749485 所解释的那样,似乎选择了两全其美的方式来实现最佳的易读性。有没有办法手动计算和调整仅适用于 IE 的字体? (另一种可能的修复方法。)

我不确定其余的模糊是从哪里来的(代码段的文本在这里看起来比我网站上的文本更清晰)。如果我们能够发现这种差异的来源,那么也许这会更容易解决。 (我一直在向代码段添加/删除 CSS,所以请原谅所有的编辑)

TL:DR,只是为了详细说明这个问题:我希望文本在 IE 中看起来像在 Firefox 或 Chrome 中一样清晰。


与 Sergey Denisov 的回答比较:

Chrome and IE before and after picture comparison虽然我可以使用 Srikanth Pullela 的回答将此 CSS 转换仅应用于 IE,但我很好奇是否存在所有浏览器修复程序。编辑:我将使用上面提到的方法,因为建议的修复会导致这种情况发生,这意味着我不能依赖 GPU 渲染来正确渲染它:

Bugged look of the popup

最佳答案

我唯一的建议是使用下面的代码并编写单独的 CSS,这样当在 IE 中打开时,它将只采用该 css。

这将仅针对早期版本的 IE8:

 <!--[if lt IE 8]>
<link href="./Content/ie7.css" rel="stylesheet" />
<![endif]-->

如果你想针对所有 IE 版本,使用这个:

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />

关于html - Internet Explorer 中的模糊文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31638488/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com