Rotation Speed


#1

Somehow my last 3 planets do not rotate around the sun at the speed they are supposed to. Please help, I have no idea why.

HTML:

<html>
    <head>
        <link rel="stylesheet" href="style.css" />
    </head>
    
    <body>

        <div id="sun">
        
            

            <div id="mercury-orbit">
                <div id="mercury">
                </div>
            </div>

            <div id="venus-orbit">
                <div id="venus">
                </div>
            </div>

            <div id="earth-orbit">
                <div id="earth">
                    <div id="moon-orbit">
                        <div id='moon' >
                    </div>
                </div>
            </div>

            <div id="mars-orbit">
                <div id="mars">
                </div>
            </div>
            
            <div id="jupiter-orbit">
                <div id="jupiter">
                </div>
            </div>
            
            <div id="saturn-orbit">
                <div id="saturn">
                </div>
            </div>

        </div>
        
    </body>
</html>

CSS:

html, body {
        width: 100%;
        height: 100%;
        background-color: black;
    }

#sun {
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: #FFBF00;
    height: 100px;
    width: 100px;
    margin-top: -50px; 
    margin-left: -50;

    border-color: #FF6A00;
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;

    box-shadow: 0 0 100px #FF6A00;
}

#mercury {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #A8822F;

    height: 14px;
    width: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
}

#mercury-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 150px;
    height: 150px;
    margin-top: -75px;
    margin-left: -75px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 3s linear infinite;
     -moz-animation: spin-right 3s linear infinite;
      -ms-animation: spin-right 3s linear infinite;
       -o-animation: spin-right 3s linear infinite;
          animation: spin-right 3s linear infinite;
}

#venus {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #3AC73E;

    height: 14px;
    width: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    
    border-color: #4EAD51;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    
    box-shadow: 0 0 20px #4EAD51;
}

#venus-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 250px;
    height: 250px;
    margin-top: -125px;
    margin-left: -125px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 5s linear infinite;
     -moz-animation: spin-right 5s linear infinite;
      -ms-animation: spin-right 5s linear infinite;
       -o-animation: spin-right 5s linear infinite;
          animation: spin-right 5s linear infinite;
}

#earth {
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #3A85D6;

    height: 20px;
    width: 20px;
    margin-left: -10px;
    margin-top: -10px;
    
    border-color: #FFFFFF;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    
    box-shadow: 0 0 40px #3A85D6;
}

#earth-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 500px;
    height: 500px;
    margin-top: -250px;
    margin-left: -250px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 7s linear infinite;
     -moz-animation: spin-right 7s linear infinite;
      -ms-animation: spin-right 7s linear infinite;
       -o-animation: spin-right 7s linear infinite;
          animation: spin-right 7s linear infinite;
}

#moon {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: white;

    height: 4px;
    width: 4px;
    margin-left: -2px;
    margin-top: -2px;
    border-radius: 50%;
    
    box-shadow: 0 0 30px white;
}

#moon-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 3s linear infinite;
     -moz-animation: spin-right 3s linear infinite;
      -ms-animation: spin-right 3s linear infinite;
       -o-animation: spin-right 3s linear infinite;
          animation: spin-right 3s linear infinite;
}

#mars {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #D64911;

    height: 14px;
    width: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    
    border-color: #B55A36;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    
    box-shadow: 0 0 20px #B55A36;
}

#mars-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 700px;
    height: 700px;
    margin-top: -360px;
    margin-left: -360px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 10s linear infinite;
     -moz-animation: spin-right 10s linear infinite;
      -ms-animation: spin-right 10s linear infinite;
       -o-animation: spin-right 10s linear infinite;
          animation: spin-right 10s linear infinite;
}

#jupiter {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #CC704B;

    height: 40px;
    width: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border-radius: 50%;
    
    border-color: #D69F89;
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;
    
    box-shadow: 0 0 20px #D69F89;
}

#jupiter-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 1000px;
    height: 1000px;
    margin-top: -500px;
    margin-left: -500px;
    border-radius: 50%;

    -webkit-animation: spin-right 15s linear infinite;
     -moz-animation: spin-right 15s linear infinite;
      -ms-animation: spin-right 15s linear infinite;
       -o-animation: spin-right 15s linear infinite;
          animation: spin-right 15s linear infinite;
}

#saturn {
    
    position: absolute;
    top: 0;
    left: 50%;
    background-color: #DEC985;

    height: 30px;
    width: 30px;
    margin-left: -15px;
    margin-top: -15px;
    border-radius: 50%;
    
    border-color: #E8D8A5;
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;
    
    box-shadow: 0 0 20px #E8D8A5;
}

#saturn-orbit {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 1300px;
    height: 1300px;
    margin-top: -650px;
    margin-left: -650px;
    border-radius: 50%;
    
    -webkit-animation: spin-right 20s linear infinite;
     -moz-animation: spin-right 20s linear infinite;
      -ms-animation: spin-right 20s linear infinite;
       -o-animation: spin-right 20s linear infinite;
          animation: spin-right 20s linear infinite;
          
}

@-webkit-keyframes spin-right {
  100% {
    -webkit-transform: rotate(360deg);
       -moz-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
         -o-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes spin-right {
  100% {
    -webkit-transform: rotate(360deg);
       -moz-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
         -o-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

#2


#3

I have tried that, but once I get to mars, they spin faster than they are supposed to.


#4

What planets are you trying to make faster and what planets are you trying to make slower.


#5

I don't know if this helps, but try this: