css - HTML div alignment using margins -


i aligning divs using margin properties

the css goes this

#top {     width:1000;     height:150; }  #left {     margin-left:0;     margin-top : 150;     width:200;     height:500; }  #right {     text-align:center;     margin-left:200;     margin-top:150; } 

i want top div @ top of page, left div towards left , right div towards right. there wrong here. right div way below left div.

for right , left divs use: float:left;

fiddle link: http://jsfiddle.net/7fjk3wxs/

css:

div {     border: 1px solid #000;      }  #top {     width:100%;     height:150; }  #left {     float: left;     text-align:center;     width: 20%; }  #right {     float: left;     text-align:center;     width: 79%; } 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -