librelist archives

« back to archive

How to make the page align center

How to make the page align center

From:
Alex
Date:
2011-05-25 @ 14:58
I use
body { width: 960px; margin-left: auto; margin-right: auto; }
to align the page center.
It works most of the time.
However, when there is a scroll bar, the page is not absolutely at the same
position as there is no scroll bar.
One of the effection is that the bannar picture floats to left a little. And
all of the page just float left.
But they are still in center regardless of the scroll bar.
I wanna to avoid it.
Anybody knows how to get it done?
Thanks.

Re: [flask] How to make the page align center

From:
Juha Mustonen
Date:
2011-05-25 @ 18:05
One solution is to always show the scrollbar. For example (css3):

body { overflow-y: scroll; }

On Wed, May 25, 2011 at 5:58 PM, Alex <gfreezy@gmail.com> wrote:

> I use
> body { width: 960px; margin-left: auto; margin-right: auto; }
> to align the page center.
> It works most of the time.
> However, when there is a scroll bar, the page is not absolutely at the same
> position as there is no scroll bar.
> One of the effection is that the bannar picture floats to left a little.
> And all of the page just float left.
> But they are still in center regardless of the scroll bar.
> I wanna to avoid it.
> Anybody knows how to get it done?
> Thanks.
>


-- 
Juha