CSS3 过渡、jQuery 等字体渲染效果不佳的问题谷歌字体
在火狐中,没有问题。这是一个图像:
http://cl.ly/3R0L1q3P1r11040e3T1i
在 Safari 中,文本渲染效果很差:
http://cl.ly/0a1101341r2E1D2d1W46
在 IE7 和IE8,差很多,不过我没有图。抱歉 :(
我正在使用 Isotope jQuery 插件,CSS3 过渡似乎会导致字体渲染效果不佳。
我也在使用 Google Font API。
这是 Isotope 的 CSS 过渡的写法:
/**** Isotope CSS3 transitions ****/
.isotope,
.isotope .isotope-item {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
transition-duration: 0.8s;
}
.isotope {
-webkit-transition-property: height, width;
-moz-transition-property: height, width;
transition-property: height, width;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
transition-property: transform, opacity;
}
我感谢任何有关此问题的帮助在火狐浏览器中看起来很棒
!
In Firefox, there is no problem. Here's an image:
http://cl.ly/3R0L1q3P1r11040e3T1i
In Safari, the text is rendering poorly:
http://cl.ly/0a1101341r2E1D2d1W46
In IE7 & IE8, it's much worse, but I don't have a picture. Sorry :(
I'm using Isotope jQuery plugin, and the CSS3 transitions seem to cause the poor font-rendering.
I'm also using Google Font API.
Here's what the CSS transitions for Isotope are written as:
/**** Isotope CSS3 transitions ****/
.isotope,
.isotope .isotope-item {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
transition-duration: 0.8s;
}
.isotope {
-webkit-transition-property: height, width;
-moz-transition-property: height, width;
transition-property: height, width;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
transition-property: transform, opacity;
}
I appreciate any help with this. Looks great in Firefox!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
暂时忘记 IE,您可以将 -webkit-font-smoothing 属性添加到 .isotope-item 样式定义中。像这样:
原因似乎与支持 3d 过渡有关。 Isotope 使用 Modernizr 自动检测对 3d 过渡的支持,并使用“translate3d”而不是“translate”。我真正想要的是:
但这似乎只在 Chrome 中有效,并使 Safari 恢复到以前的样子。需要明确的是,Chrome 不会出现抗锯齿问题,但确实尊重上面的样式定义。
我正在考虑修改 isotope 的来源,以便它只将字体平滑定义添加到支持 3D 转换的浏览器(即 Safari),而只保留 Chrome。
Forgetting IE for a minute, you can add the -webkit-font-smoothing property to the .isotope-item style definition. Like this:
The reason seems to have something to do with supporting 3d transitions. Isotope automatically detects support for 3d transitions using Modernizr and uses "translate3d" instead of "translate". What I really want is:
But that only seems to work in Chrome and puts Safari back the way it looked before. To be clear, Chrome doesn't exhibit the anti-aliasing problem but does respect the style definitions above.
I'm considering modifying the source of isotope so that it only adds this font smoothing definition to browsers supporting 3D transforms (ie. Safari) and leaves Chrome alone.
不幸的是,您实际上无能为力。它与 IE 用于创建不透明度的 alpha 过滤器有关,但我从未见过它的修复方法。
Unfortunately, there's not really anything you can do. It has to do with the alpha filters that IE uses to create opacity and I've never seen a fix for it.