Forum Moderators: not2easy

Message Too Old, No Replies

Centering div with overflow hidden

         

wardy83

11:04 am on Apr 2, 2008 (gmt 0)

10+ Year Member



Ok... here it goes...

I want a div centered when overflow is hidden.

Basically I have a div about 900px wide div with a background image, when people have a 800px resolution this div should be centered rather than showing the left hand side of the div with the rest cut off.

ie. left and right hand sides should be cut off for the div to show properly (centered) in 800px rather than right hand side cut off.

the div is centered correctly when using resolutions above 800x600.

All help greatly appreciated! Many thanks.

John.

SuzyUK

2:02 pm on Apr 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi John.. whats the whole CSS for the div with background image and is it just a 'wrapper' div?

Dave75

3:24 pm on Apr 2, 2008 (gmt 0)

10+ Year Member



Apply the following property to the centered div:

background:url('image.png') top center no-repeat;

I'm not quite sure that is what you're after without looking at the code you have...