Chrome 51中的背景大小转换 - 错误或功能?

时间:2016-05-31 11:55:46

标签: html css google-chrome css-transitions

背景大小转换不再适用于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;
&#13;
&#13;

更新

正如@ Paran0a所注意到的,它适用于特定于供应商的前缀,所以它可能是一个错误(提交错误报告):

&#13;
&#13;
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;
&#13;
&#13;

2 个答案:

答案 0 :(得分:4)

答案 1 :(得分:4)

遇到这个问题,并且能够通过改变我的规则来修复它

background-size:115%;

background-size:115%115%;