如何使自定义CSS游标与视网膜兼容?

时间:2012-08-14 19:38:32

标签: css retina-display mouse-cursor

我想知道如何在视网膜显示器上的webapp中使用自定义光标。我知道通常情况下,由于比例因子,图像将以正常尺寸的两倍显示,并且在使网站与视网膜显示器兼容时,您必须采用2倍比例图像,并设置其浏览器内渲染宽度和高度为实际尺寸的一半。由于游标没有大小属性​​(据我所知),如何确保以最高保真度呈现光标?

感谢。

1 个答案:

答案 0 :(得分:-4)

我非常喜欢提出的通用解决方案here,尤其是作者记得定位所有可以在带有Retina Display的Macbook Pro上运行的浏览器。

@media only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
    /*your hi-res cursor styling*/
}

我很好奇,如果在相同的硬件(使用Bootcamp或Parallels等)上运行,这在Windows中可以正常工作。

相关问题