Forum Moderators: not2easy

Message Too Old, No Replies

problem centering a block horizontally both IE and Firefox

         

eonian

4:22 pm on May 10, 2008 (gmt 0)

10+ Year Member



Hi,

I try to center a block only horizontally using :

.conteneur {
height: 435px;
width: 689px;
margin: 0 auto;
text-align: left;

}

IE works fine but Firefox center the block not only horizontally but vertically too!

How to avoid that? I want my block to stay at the top vertically in firefox.

Thank you very much for your help.

Marshall

2:32 am on May 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



eonian, welcome to WebmasterWorld.

Sounds like a body and padding issue. Set the body

body {
margin: 0;
padding: 0;
}

and add

.conteneur {
height: 435px;
width: 689px;
margin: 0 auto;
text-align: left;
padding: 0;
}

Remember, different browser clients have different defaults for their margins and padding in all elements. This is most obvious with <h> tags.

Marshall