http://jsfiddle.net/ubcka/14/
在Chrome或Safari中,动画化background-size属性似乎不起作用。
谢谢!
div { width: 161px; height: 149px; background: url(http://3.bp.blogspot.com/_HGPPifzMEZU/Rw4ujF12G3I/AAAAAAAAAWI/bc1ppSb6eKA/s320/estrelas_09.gif) no-repeat center center; background-size: 50% 50%; -webkit-transition: background-size 2s ease-in; -moz-transition: background-size 2s ease-in; transition: background-size 2s ease-in; } div:hover { background-size: 100% 100%; }
解决方法
您应该检查浏览器版本,是否支持背景大小和转换。如果前者,而不是后者使用:
transition: background-size 2s ease-in; -moz-transition: background-size 2s ease-in; -ms-transition: background-size 2s ease-in; -o-transition: background-size 2s ease-in; -webkit-transition: background-size 2s ease-in;