CSS3动画的问题

nal*_*mur 5 html javascript css jquery css3

这是我的第一个问题,我为此感到高兴

我创建了一个包含fullpage.js 路线图的页面

我会用CSS3创建一个动画,所以我看到了一个简单的教程

我按照说明操作并将代码粘贴到roadmap.html动画效果很好,但我不知道为什么有14枚带有蓝色底座的火箭.你可以在这里看到"故障"

js有什么错误吗?这是css的问题吗?

<style>#outerspace{position:relative;height:400px;background:#0c0440 url('http://www.the-art-of-web.com/images/rocket.gif');color:#fff;}div.rocket{position:absolute;bottom:10px;left:20px;-webkit-transition:3s ease-in;-moz-transition:3s ease-in;-o-transition:3s ease-in;transition:3s ease-in;}div.rocket div{width:92px;height:215px;background:url('http://www.the-art-of-web.com/images/rocket.gif') no-repeat;-webkit-transition:2s ease-in-out;-moz-transition:2s ease-in-out;-o-transition:2s ease-in-out;transition:2s ease-in-out;}#outerspace:hover div.rocket{-webkit-transform:translate(0px,-5400px);-moz-transform:translate(0px,-5400px);-o-transform:translate(0px,-5400px);-ms-transform:translate(0px,-5400px);transform:translate(0px,-5400px);}</style>
Run Code Online (Sandbox Code Playgroud)

提前致谢

Uma*_*han 3

这是因为你的 CSS 中的第一件事就是你所说的#outerspace

background: #0c0440 url('http://www.the-art-of-web.com/images/rocket.gif');
Run Code Online (Sandbox Code Playgroud)

url 部分根本不应该存在。如果你写了no-repeat,仍然会有 1 枚不应该在那里的火箭,所以总结一下:

url('http://www.the-art-of-web.com/images/rocket.gif')background中取出#outerspace

代码应该是:

background: #0c0440;
Run Code Online (Sandbox Code Playgroud)

这是你的保证:

background: #0c0440 url('http://www.the-art-of-web.com/images/rocket.gif');
Run Code Online (Sandbox Code Playgroud)
background: #0c0440;
Run Code Online (Sandbox Code Playgroud)