error:"Did you add..."


#1

I added 'position: absolute;' but there is an error so:
Oops, try again. Did you add 'position: absolute;' to your #earth-orbit style?
what is the wrong? :sweat:


#2

please paste in your CSS code so we can have a look and help you


#3

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;
}

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

#earth-orbit { 
    position: absolute;
    top: 50%;
    left: 50%;
    
    width: 500px;
    height: 500px;
    margin-top: -250px;
    margin-left: -250px;
    
    border-width: 2px;
    border-style: dotted;
    border-color: white;
    border-radius: 50%;
}
 /* For Section #2 */
 
}
that is my style.css working.. now I'm adding instructions.
01.
Click on style.css tab in your editor.

02.
Change the CSS stylesheet to include the following:

Edit #earth

#earth {
    position: absolute;
    top: 0;
    left: 50%;

    height: 50px;
    width: 50px;
    margin-left: -25px;
    margin-top: -25px;
}
Edit #earth-orbit

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

    width: 500px;
    height: 500px;
    margin-top: -250px;
    margin-left: -250px;

    border-width: 2px;
    border-style: dotted;
    border-color: white;
    border-radius: 50%;
}

03.
Play with the top, left, width, and height values and see what changes.

I'm really thankful for your answer :slight_smile::blossom:


#4

your #eart I'm guessing should be #earth also you have two closing brackets for it thus breaking the code


#5

I'm really thankful dear friend :slight_smile: your advices worked :slight_smile:


#6

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.