javascript - different size divs align top left -
css
#box1, #box2, #box3, #box4, #box5, #box6, #box7, #box8, #box9, #box10, #box11, #box12, #box13, #box14, #box15, #box16, #box17, #box18, #box19, #box20 { position: relative; list-style: none; float: left; clear:left: } #box1 { width: 60px; height: 60px; background: yellow; } #box2 { width: 80px; height: 50px; background: blue; } #box3 { width: 40px; height: 60px; background: red; } #box4 { width: 200px; height: 150px; background: green; } #box5 { width: 60px; height: 100px; background: red; } #box6 { width: 70px; height: 30px; background: blue; } #box7 { width: 40px; height: 80px; background: yellow; } #box8 { width: 90px; height: 60px; background: red; } #box9 { width: 50px; height: 80px; background: blue; } #box10 { width: 40px; height: 60px; background: yellow; } #box11 { width: 60px; height: 60px; background: yellow; } #box12 { width: 80px; height: 50px; background: blue; } #box13 { width: 40px; height: 60px; background: red; } #box14 { width: 100px; height: 50px; background: yellow; } #box15 { width: 60px; height: 100px; background: red; } #box16 { width: 70px; height: 30px; background: blue; } #box17 { width: 40px; height: 80px; background: yellow; } #box18 { width: 90px; height: 60px; background: red; } #box19 { width: 50px; height: 80px; background: blue; } #box20 { width: 40px; height: 60px; background: yellow; }
i need align multiple divs top left, without spaces between divs. need, 1 div stay exact place, need (like "green" div place center of window). in fiddle, can see p17 , p18 not place other divs. there space on divs. need put these 2 divs space.how can fix without giving margins.
and if add new divs, need automaticaly attach divs other divs, same way in demo, without space. there way this.
check [demo][1] |__|| || || | | ||__||_____|| | | || ||___| |__||_________||___| | || || | |__||______||______| ![drawing][2] need align divs in above demo, drawing.
please add css :
#box1, #box2, #box3, #box4, #box5, #box6, #box7, #box8, #box9, #box10, #box11, #box12, #box13, #box14, #box15, #box16, #box17, #box18, #box19, #box20 { margin:0px; padding:0px; float: left; } ul, li { margin:0px; padding:0px; list-style:none;}
Comments
Post a Comment