Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, January 7, 2014

Codecademy - Sun, Earth, and Code: Orbit with style!


// Sample solution to style.css

html, body {
    /* The universe takes up all available space */
    width: 100%;
    height: 100%;
   
    /* The universe is black */
    background-color: black;
}

#sun {
    position: absolute;
    /* Positions the top-left corner of the image to be *
    /* in the middle of the box */
    top: 50%;
    left: 50%;
   
    /* Play with these numbers to see what it does */
    height: 200px;
    width: 200px;
    margin-top: -100px;
    margin-left: -100px;
   
    border-color: orange;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
    border-shadow: 0 0 64px yellow;
}

#earth {
    /* Style your earth */
    position: absolute;
    top: 25%;
    left: 25%;
   
    height: 50px;
    width: 50px;
    margin-left: -25px;
    margin-top: -25px;
}

#earth-orbit {
    /* For Section #2 */
    position: absolute;
    top: 50%;
    left: 50%;
   
    height: 500px;
    width: 500px;
    margin-left: -250px;
    margin-top: -250px;
   
    border-width: 2px;
    border-style: dotted;
    border-color: white;

    border-radius: 50%;


}

Back to list of sample solutions for Sun, Earth, and Code

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts