Centering a div...in IE6

Hi everyone…

Please help me. Paul helped me so far with my site… I need to place a .png (in a div called .underline) file centered under the .intro div on this page. I am able to do this in all the browsers but in IE6 in shifts to the left…:sick: I am not sure what happens here…can you help me please?

http://www.rajeevthomas.com/

Euhm, why support IE6?
only 3.9% of all internet users use IE6 as browser…

(I would just advice an update or an other browser)

Are you sure that absolutely nothing precedes the doctype tag in the source of the page. Even a space or byte order mark will throw IE6 into quirks mode.

felgall I do not know much about CSS …am I supposed to place anything after the doctype tag? where do I find this info?

Garon I have some friends who still uses IE6…:slight_smile: not very cool I know…

I know, my reply was stupid… I came home and read up on the doctypes and I made sure nothing is before the doctype I am using. But it still does not corrects the problem. :confused:

Hi guys…

I just read a very informative article –> http://dorward.me.uk/www/centre/ and it said…

The default width for most block level elements is auto, which fills the available area on screen. Just being centred places it in the same position as left alignment. If you wish it to be visually centred you should set a width (or a max-width although Internet Explorer 6 and earlier do not support this, and IE 7 only supports it in standards mode).

God!! so much to learn!!! This really helped to solve the problem… :slight_smile: Thank you guys…

Yes to center block elements you need to give them a width and then using margin:0 auto to center them.

To center inline elements you would just apply text-align:center on the parent.

Glad you got it sorted.:slight_smile:

Thank you very much Paul… I appreciate your help always… :slight_smile: