Topic: Help with max-width and centreing

I`m trying to set the max width for punbb which I can get working but the board doesn`t centre, here`s what I`m using to set max-width..

#punwrap {
    margin: 12px 20px;
    max-width: 1000px;
}

I`ve tried a few things but nothing works. Is it even possible to centre something that has a max width set?

Re: Help with max-width and centreing

HTML, BODY {MARGIN: 5; PADDING: 5}
#punwrap {width: 750px; margin: 12px auto}

Replace it with that, change 750px to whatever smile

Re: Help with max-width and centreing

Thanks but I`m after max width not fixed width. I just want to prevent the board from stretching to wide on higher resolutions while keeping the fluid layout.

Re: Help with max-width and centreing

Oh, wouldn't it be good to put a % in?

5 (edited by oneless 2007-11-02 00:09)

Re: Help with max-width and centreing

hmm hold on lets see

EDIT

Ok all it needed was the auto on the margin roll

Here`s the final concoction, the board has a max width of 1024 and is centred.

HTML, BODY {MARGIN: 4px; PADDING: 0;}
#punwrap {
    margin: 0 auto;
    max-width: 984px;
}

Thanks for the inspiration Urilockz. smile

6

Re: Help with max-width and centreing

#punwrap {
    max-width: 100px;
    margin: 12px auto;
   }

max-width works just fine for me. You aren't expecting it to work in IE6 are you?

7 (edited by oneless 2007-11-02 00:21)

Re: Help with max-width and centreing

Oh just seen your reply paul, I edited my post earlyer with the solution. Was just missing "auto"

It`s working in IE6 too accept the board appears at full width and then shrinks to max-width, all in a split second causing a sort of flicker effect. Works ok in Opera and going to try IE7 shortly.

8

Re: Help with max-width and centreing

It only works in IE6 because of the min-max javascript file which is used to auto size images in IE6. IE6 doesn't actually support max-width.

Re: Help with max-width and centreing

Thanks for the information.