以下是我正在开发的网站的部分 CSS 代码。 .textbox:hover 部分在本地工作正常,但当我将其上传到服务器时却不行。
文本框是一些动画并应在悬停时暂停的文本。动画的其余部分工作正常,但悬停部分没有。我首先认为存在一些浏览器不兼容问题,但看起来它是另外一回事,因为它在所有浏览器上都一样。任何帮助将不胜感激。
/* CSS for textbox */
.textbox
{
width:100px;
height:100px;
background:red;
position:relative;
animation-name:myfirst;
animation-duration:5s;
animation-timing-function:linear;
animation-delay:2s;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-play-state:running;
-webkit-animation-name:myfirst;
-webkit-animation-duration:5s;
-webkit-animation-timing-function:linear;
-webkit-animation-delay:2s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:alternate;
-webkit-animation-play-state:running;
}
.textbox:hover
{
-webkit-animation-play-state:paused;
animation-play-state:paused;
}
@keyframes myfirst {
0% {background:48D1CC; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
100% {background:#DCDCDC; left:0px; top:0px;}
}
@-webkit-keyframes myfirst { /* Safari and Chrome */
0% {background:#DCDCDC; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
100% {background:#DCDCDC; left:0px; top:0px;}
}