HTML CSS examples for CSS Widget:Div
Center div inside parent div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #number-one {<!-- w w w. ja v a2 s . c o m--> border:2px solid; display:block; height:301px; vertical-align:middle; width:301px; } #number-two { background-color:Chartreuse; height:100px; margin:100px; width:100px; } </style> <script type="text/javascript"> </script> </head> <body> <div id="number-one"> <div id="number-two"></div> </div> </body> </html>