HTML CSS examples for CSS Layout:Box
Fours boxes equally separated
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #test-box {<!--from www. j a v a 2 s . co m--> border:2px solid Chartreuse; width:21%; box-sizing:border-box; float:left; height:100px; margin-top:121px; } #firstleft-box { position:absolute; display:block; left:21%; border:3px solid yellow; width:100px; height:100px; } #secondleft-box { position:absolute; display:block; left:41%; border:3px solid blue; width:100px; height:100px; } #firstright-box { position:absolute; display:block; left:61%; border:3px solid pink; width:100px; height:100px; } #secondright-box { position:absolute; display:block; left:81%; border:3px solid OrangeRed; width:100px; height:100px; } </style> </head> <body> <div id="firstleft-box"></div> <div id="secondleft-box"></div> <div id="firstright-box"></div> <div id="secondright-box"></div> <div id="test-box"></div> <div id="test-box"></div> <div id="test-box"></div> <div id="test-box"></div> <div id="test-box"></div> </body> </html>