HTML CSS examples for CSS Layout:Div Align
Align elements in div vertical, alignment
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!--from w w w . j av a2s .c o m--> background:gray; height:301px; width:100%; position:relative; } .container>div { height:100px; width:100px; position:absolute; } div.left { background:green; left:0; bottom:0; height:251px; } div.middle { background:red; left:100px; bottom:0; top:51%; margin-top:-51px; } div.right { background:blue; right:0; top:51%; margin-top:-51px; } </style> </head> <body> <div class="container"> <div class="left"> </div> <div class="middle"> </div> <div class="right"> </div> </div> </body> </html>