First the css code and then the question. <html><head> <title>My Blog Page</title> <link rel="stylesheet" type="text/css" href="my_first.css" /> </head> <body><h1>My Blog Page</h1> <div id="wrap"> <div id="sidebar"><center><b>Widgets Go Here</b><p>widgets</p><p>widgets</p></center></div> <div id="container"><center><b>My first text of my blog.</b></center></div> <div class="clear"></div> </div> </body> </Html> my_first.css file's css coding is: body { background-repeat:no-repeat; background-color:#c0c0c0; width:100%; height:100%; } h1 { color:#ffffff; margin-top:50px; text-align:center; } #wrap { margin:35 80 10 80; background-color:#ffffff; overflow:inherit; border:solid 1px c0c0c0; } #container { background-color:#ffffff margin-right:300px; margin-left:10px; margin-top:10px; width:700px; padding:4px; border:1px; border-style:solid; border-color:c0c0c0; } #sidebar { background-color:#ffffff; margin-top:10px; margin-right:10px; margin-bottom:10px; border:1px; border-style:solid; border-color:c0c0c0; float:right; width:350px; padding:4px; } .clear { clear:both; } The problem is that I am not able to provide an upper margin to the container id and the "top walls" of container id merge with the top walls of wrap id. Second question is that in order to make sure that the id "side bar" appears right beside the container id, I have to place "sidebar" before container in an HTML file. I want to know that what's the logic behind it. Yeah I know there are many useless tags in it so please do not point them out.
Float the container left. It will fix the margin problem, and you can put the sidebar after it. But the biggest problem is the zillions of useless....oh!
Here`s a tip if you want to use more margins (left, right, etc) instead of putting: margin-top:1px; margin-right:2px; margin-bottom:3px; margin-left:4px; you can use: margin: 1px 2px 3px 4px;
@cash nebula @pawel @digital29 Thanks to all for your help. @digital29 I believe that the margin you have advised works in the clockwise manner which means top, right, bottom and left. Am I right? @pawel Thanks for your time typing this whole chunk of code along with the comments which helped me a lot in understanding it.