Center DIV

Hi, this is my first post on this list. Does anybody know 
an efficient way to place a <div> on the center of the 
page? I've tried everything. I read an article over @ (url below) and the technique he teaches seems 
to be the perfect approach (in terms of CSS), but 
unfortunately, it doesn't work in IE.

The *solution* I found was to position the image at 50% of 
the page and then compensate with a negative margin (with 
half of the size of the image). For example:

    <style type="text/css">
    div.icon {
        position: absolute;
        margin-top: -20px;
        margin-left: -20px;
        top: 50%; left: 50%;
    <div class="icon">
        <img src="image.gif" alt="Image" />

Any advice would be highly appreciated... :)

Jonas Galvez

Received on Thursday, 3 July 2003 10:08:58 UTC