【发布时间】:2014-06-25 19:58:07
【问题描述】:
在两种不同字体大小之间应用 CSS 过渡时,生成的动画在 Firefox 中是平滑的,但在 Chrome 中却很不稳定。
div {
font-size: 87.5%;
padding: .5em;
margin: .5em;
transition: font-size .25s ease-in-out .25s,
padding .25s ease-in-out .25s,
margin .25s ease-in-out .25s;
}
div:hover {
font-size: 100%;
}
现场演示: http://jsfiddle.net/B7Zyp/2/(将鼠标悬停在带有蓝色边框的框上)
这是为什么呢?有没有办法让 Chrome 中的动画流畅?
【问题讨论】:
-
我认为这不是浏览器的问题。首先,每个字符每次都需要增加一点,许多字符的像素差异的集合是肉眼可见的。其次,每行的断行会迫使单词换行,会感觉起伏不定。
-
@Daniel Cheung:那么为什么 Firefox 能够比 Chrome 做得更好?
-
@Šime Vidas,好吧,它给我带来了不同(ubuntu 上一个相当老的 chrome [18.0.xx])但足够公平。删除了这个无用的答案。
标签: html css google-chrome firefox animation