本文介绍了我可以在浏览器中获得一致的CSS颜色吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试一个新网站,我有一个div

  background-color:#bbf6bb; 

这对我来说似乎无关紧要。然而,在我的MacBook Pro,颜色看起来非常不同的Firefox 3.6与Safari 4.在Safari中,它是我期望从十六进制值的颜色:浅绿色。



我知道不同浏览器对图像的不同处理产生的颜色不一致,但在纯CSS ?真?我猜火狐试图纠正我的显示,希望提供更好的一致性打印,但我宁愿我的网站看起来与我的用户相同的色调,无论他们选择的浏览器。有任何想法吗?有人可以确认Firefox是这里的罪魁祸首吗?



[更新:这似乎是一个侥幸。具体来说,这是Firefox的一个狭窄的问题 - 请参阅下面的答案。我很困惑,但很放心。]

解决方案

我已经孤立的问题!这绝对是一个Firefox 3.6错误(在Mac OS 10.6上运行)。似乎与打开大量的标签有关。如果我创建一个新的选项卡,并转到页面,我得到略微偏离的颜色(蓝绿色,而不是只是绿色)。如果我创建一个新窗口并转到同一页面,颜色是准确的。

[编辑:屏幕截图放错位置,但我支持这个答案。]

/ p>

I'm testing a new site, and I have a div with

background-color: #bbf6bb;

That seems innocuous enough to me. And yet, on my MacBook Pro, the color looks very different in Firefox 3.6 vs. Safari 4. In Safari, it's the color I'd expect from the hex value: a pale green. In Firefox, there's a definite bluish tint, making the color turquoise.

I'm aware of color inconsistencies that result from different treatment of images across browsers, but in pure CSS? Really? I'm guessing that Firefox trying to correct for my display in hopes of delivering better consistency with print, but I'd much rather have my site look the same hue to my users regardless of their choice of browser. Any ideas? Can someone confirm that Firefox is the culprit here?

[Update: This seems to have been a fluke. Specifically, it's a narrow issue with Firefox—see my answer below. I'm puzzled, but relieved.]

解决方案

I've isolated the issue! It's definitely a Firefox 3.6 bug (running on Mac OS 10.6). Seems to have something to do with having a large number of tabs open. If I create a new tab and go to the page, I get the slightly off colors (blue-green instead of just green). If I create a new window and go to the same page, the colors are accurate. And yes, this still occurs if I refresh both instances.

[Edit: Screenshot got misplaced, but I stand by this answer.]

这篇关于我可以在浏览器中获得一致的CSS颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 23:03