【发布时间】:2023-03-20 12:55:01
【问题描述】:
.picture-box img {
display: inline-block;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
filter: grayscale(100%);
-webkit-filter: grayscale(1);
-moz-filter: grayscale(1);
-o-filter: grayscale(1);
-ms-filter: grayscale(1);
}
.picture-box img:hover {
filter: none; /* IE6-9 */
filter: grayscale(0);
-webkit-filter: grayscale(0);
-moz-filter: grayscale(0);
-o-filter: grayscale(0);
-ms-filter: grayscale(0);
-webkit-transition: all 2.0s ease-out;
-moz-transition: all 2.0s ease-out;
-ms-transition: all 2.0s ease-out;
-o-transition: all 2.0s ease-out;
transition: all 2.0s ease-out;
}
这段代码有什么问题?转换在 Firefox 中不起作用。我已经安装了 21.0。
【问题讨论】:
-
您是否尝试将
top:值添加到两者?例如。top:0;。如果你给我一个 jsFiddle,我肯定能修复它 -
让我把它放在一个小提琴中。
-
你有 jsFiddle 吗?把它链接在这里:)
-
jsfiddle.net/amrebel/D9dUAthanx :)
标签: css firefox css-transitions transition