Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:36:29+00:00 2026-06-03T11:36:29+00:00

Consider CSS3 animation with ship moving above blue div. For some reason the ship

  • 0

Consider CSS3 animation with ship moving above blue div. For some reason the ship isn’t moving. The HTML is as follows:

<div id="wrapper">
  <div id="sea">
    <img src="ship.png" alt="ship" width="128" height="128"/>
  </div>
</div>

In order to make CSS3 animation I use the following:

#wrapper { position:relative;top:50px;width:700px;height:320px;
          margin:0 auto;background:white;border-radius:10px;}
#sea { position:relative;background:#2875DE;width:700px;height:170px;
       border-radius:10px;top:190px; }
#sea img { 
  position:relative;left:480px;top:-20px;
  animation:myship 10s;
  -moz-animation:myship 10s; /* Firefox */
  -webkit-animation:myship 10s; /* Safari and Chrome */
  @keyframes myship {
    from {left: 480px;} 
    to{left:20px;} 
   }
   @-moz-keyframes myship {
     from {left: 480px;} 
     to {left:20px;} 
   }
   @-webkit-keyframes myship {
     from {left: 480px;} 
     to{left:20px;} 
   }
}

The ship image isn’t moving. Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:36:31+00:00Added an answer on June 3, 2026 at 11:36 am

    you have to declare your keyframe outside the css selector, as well as animate an absolutely positioned element.

    http://jsfiddle.net/aNvSf/

    your modified css looks like this:

    #wrapper{
        position:relative;
        top:50px;
        width:700px;
        height:320px;
        margin:0 auto;
        background:white;
        border-radius:10px;
    }
    #sea{
        position:relative;
        background:#2875DE;
        width:700px;
        height:170px;
        border-radius:10px;
        top:190px;
    }
    #sea img{
        position:absolute;
        left:480px;
        top:-20px;
        animation:myship 10s;
        -moz-animation:myship 10s; /* Firefox */
        -webkit-animation:myship 10s; /* Safari and Chrome */               
    }
    
    @keyframes myship{
        from {left: 480px;} 
        to{left:20px;} 
    }
    @-moz-keyframes myship{
        from {left: 480px;} 
        to{left:20px;} 
    }
    @-webkit-keyframes myship{
        from {left: 480px;} 
        to{left:20px;} 
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following script for outputting some XML code: var xmlAsString = '<?xml version=1.0?><person><name
Consider such html piece: <p>foo</p><p>bar</p> If you run (for example) jQuery text for it
Consider the following common situation: You have some MainView in your Cocoa application, loaded
Consider this HTML: <form id=MyForm> <input name=Input1/> </form> In Script# I do this: FormElement
Consider an article inside a div that has many <p> tag. Is there any
Consider a computer with five individual resources name R1 …. R5. Let five processes
consider a = ['1','2','3','4','5'] for(var i = 0; i < a.length; i++) { if
Consider: Public MustInherit Class Column Public ReadOnly Property ReturnSomethingUseful() As Object Get 'return something
Consider these pseudo models: class City(models.Model): name = models.CharField() region = models.ForeignKey(Region) class Region(models.Model):
Consider the code below. I do not want to create multiple instances of class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.