Wednesday, July 10, 2013

Center a div element in a web page

To center an <DIV> element on the middle of a web page:

<body>
    <div style="width:800px; margin:0 auto;">
        centered content
    </div>
</body>

No comments:

Post a Comment