最近,我在Firefox的精灵动画中遇到代码问题。
我的Sprite图片文件包含高质量的图形,因此图片大小超过3MB。具有相同代码的相同图像在Chrome中可以正常工作。
下面是我的代码:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css">
body {
background-color: grey
}
.myDiv {
width: 650px;
height: 650px;
background: url(imagepath) top center;
animation: animatename 4s steps(120) infinite;
}
@keyframes animatename {
100% {
background-position: 0px -78000px;
}
}
</style>
<body>
<div class="myDiv"></div>
</body>
</html>