HTML CSS examples for CSS Layout:Responsive Layout
center my div in responsive design way
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #Outer {<!-- ww w. j a v a 2 s. com--> width:151px; height:151px; background:yellow; text-align:center; } #Inner { display:inline-block; background:red; margin-left:auto; margin-right:auto; } #Inner div { display:inline-block; } </style> </head> <body> <div id="Outer"> <div id="Inner"> <div> Lorem </div> <div> Lorem </div> <div> Lorem </div> </div> </div> </body> </html>