Mat*_*att 3 css google-chrome colors hover linear-gradients
最新的Chrome版本(49)中存在一个错误,其中CSS就像......
background: linear-gradient(currentColor, green);
Run Code Online (Sandbox Code Playgroud)
... color元素更改时不会更新(例如:on:hover).
我该如何解决这个问题?
如果重绘元素,渲染将更新(请参阅此问题).
例如
color通过另外更改触发重绘的任意属性,可以在元素更改时强制重绘.
该物业应该......
.box {
width: 200px;
height: 200px;
background: linear-gradient(currentColor, green);
color: #f00;
}
.box:hover {
color: blue;
/* arbitrary webkit-only property that forces a redraw */
-webkit-margin-start: .1px;
}Run Code Online (Sandbox Code Playgroud)
<div class="box"></div>Run Code Online (Sandbox Code Playgroud)