Tag Archives: html

HTML – center an image vertically & horizontally

<body> <table id=”table-foo”> <tr><td> <img sr=”foo.png” /> </td></tr> </table> </body> <style type=”text/css”> html, body { height: 100%; } #table-foo { width: 100%; height: 100%; text-align: center; vertical-align: middle; } #table-foo img { display: block; margin: 0 auto; } </style>

Posted in Others | Tagged , | 1 Comment