CSS positioning, need some advice

Viewed 101

Here is my HTML code

<div id="container">
        <div id="topleft"></div>
        <div id="topright"></div>
        <div id="bottomleft"></div>
        <div id="bottomright"></div>
    </div>

Here is my css code

#container{
    width: 400px;
    height: 400px;
    background-color: red;
    margin: 0 auto;

}

#topright{
    width: 50px;
    height: 50px;
    background-color: black;
    position: relative;
    top:0px;
    right:0px;
}
#topleft{
    width: 50px;
    height: 50px;
    background-color: black;
    position:relative;
    top:0px;
    left:350px;
}

#bottomright{
    width: 50px;
    height: 50px;
    background-color: black;
    position: relative;
    top:250px;
    right:0px;
}
#bottomleft{
    width: 50px;
    height: 50px;
    background-color: black;
    position:relative;
    top:250px;
    left:350px;
}

Here is output http://s23.postimg.org/dhgy9mpq3/image.png

What I need to obtain, is that all 4 black square to be positioned in the corner of the red square like in this image, what should i change or add in code? THX http://postimg.org/image/r5kv15l5v/

5 Answers
Related