我的问题是@-webkit-keyframes 动画不起作用,我没有看到任何线索......所有其他部分都运行良好,包括背景颜色和字体颜色过渡。这是HTML和CSS:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
<link rel="stylesheet" href="test.css" />
</head>
<body id="body">
<nav>
<ul id="nav">
<li><a href="#" class="link"><div class="content"><span class="span">About</span></div></a></li>
<li><a href="#" class="link"><div class="content"><span class="span">Skills</span></div></a></li>
<li><a href="#" class="link"><div class="content"><span class="span">Works</span></div></a></li>
<li><a href="#" class="link"><div class="content"><span class="span">Contact</span></div></a></li>
</ul>
</nav><br />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript" src="jquery_ui.js"></script>
</body>
</html>
CSS:
#nav{
list-style:none;
margin:40px auto;
padding:0;
width: 820px;
}
#nav li{
width: 200px;
height: 300px;
overflow: hidden;
position: relative;
float: left;
background: #00D8CC;
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
margin-right: 2px;
-webkit-transition: all 300ms linear;
}
#nav li:last-child {
margin-right: 0px;
}
#nav li a{
display:block;
text-align: center;
position: relative;
height: 100%;
color: #333;
}
.content {
position: absolute;
left: 0px;
width: 100%;
height: 50%;
top: 50%;
}
.span {
font-size: 30px;
opacity: 0.8;
text-align: center;
line-height: 40px;
-webkit-transition: all 300ms linear;
}
#nav li:hover {
background-color: #00AAAA;
}
#nav li:hover .span{
color: green;
-webkit-animation: move 300ms ease;
}
@-webkit-keyframes move {
from {
-webkit-transform: translateX(-100%) rotate(-90deg);
}
to {
-webkit-transform: translateX(0%) rotate(0deg);
}
}
谢谢你。