背景大小转换不再适用于Chrome 51。我知道它永远不应该工作(见this),但确实如此,并且仍然有很多人使用它。我正在谈论悬停时的百分比转换。
我想知道这是否是新Chrome中的错误(这是可能的,因为这个版本会带来很多新内容),或者他们已经决定暂时取消这个过渡?
其他浏览器没有问题。
div {
background: url(http://cdn2.business2community.com/wp-content/uploads/2014/12/Super-Mario-no-longer-the-007.jpg) no-repeat center center;
background-size: 50%;
display: inline-block;
height: 276px;
width: 460px;
transition: all 0.5s linear;
}
div:hover {
background-size: 100%;
}

<div></div>
&#13;
正如@ Paran0a所注意到的,它适用于特定于供应商的前缀,所以它可能是一个错误(提交错误报告):
div {
background: url(http://cdn2.business2community.com/wp-content/uploads/2014/12/Super-Mario-no-longer-the-007.jpg) no-repeat center center;
-webkit-background-size: 50%;
display: inline-block;
height: 276px;
width: 460px;
transition: all 0.5s linear;
}
div:hover {
-webkit-background-size: 100%;
}
&#13;
<div></div>
&#13;
答案 0 :(得分:4)
原来是一个错误:https://bugs.chromium.org/p/chromium/issues/detail?id=616072
计划在下一个里程碑中修复,这是补丁:https://chromium.googlesource.com/chromium/src.git/+/8793a7bac4d2d56e38c8bd406920128e1ceb7a9a
答案 1 :(得分:4)
遇到这个问题,并且能够通过改变我的规则来修复它
background-size:115%;
到
background-size:115%115%;