FORUMS: list search recent posts

centering pages

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
EJ5155centering pages
by on Oct 3, 2006 at 10:56:38 pm

I'm totally new to the web design world. i'm using GoLive and am trying to make my own page. I would like to make it so my page sits in the centre of the browser no matter what the size of the window is. i'm confused. I was trying to use the margins on the page inspector but that seems to just place it away from the left and top. What's the deal, how can I do this and is this a CSS thing? Thanks for your time.

Return to posts index

Curtis ThompsonRe: centering pages
by on Oct 3, 2006 at 11:58:49 pm


old-school way is to put your content in a table that is 100% wide and 100% high - you can do it in css, though:


Return to posts index

EJ5155Re: centering pages
by on Oct 4, 2006 at 12:30:05 am

Thanks very much.

Return to posts index

Joe RugbyRe: centering pages
by on Oct 4, 2006 at 7:17:45 pm

I"ll often start with a layout grid and then hit center instead of default in the inspector (Align Menu).




Return to posts index

Bret WilliamsRe: centering pages
by on Oct 6, 2006 at 5:34:04 am

I was having a hit and miss experience with that old school way for awhile. New pages from scratch didn't work, so I'd copy an old design and rework it and it would work. Guess what? If you're using a new doctype, it doesn't fly. Which my new pages were using since I probably had a DW update. You've got to use an older doctype or none at all to get the 100% table trick to work.

Return to posts index

tommycushRe: centering pages
by on Oct 28, 2006 at 7:07:18 pm

i have no experience with golive, but let me show you how i do this in css. i'm sure you can apply the idea to golive, too.

in css it would look like this:

#centeredlayer {
position: absolute;
width: 500px;
height: 500px;
top: 50%;
left: 50%;
margin-left: -250px;
margin-top: -250px;

then in your html-file include a div-layer like this:


what this does is create a layer 500px wide and 500px high. the css tells the html-file to first position the upper left corner of the layer to the exact center of your browser-window (top and left set to 50%) then it moves the box back up and to the left 250 pixels, which is half of the layers height and width (margin-top and margin-left -250px).

this way your layer always stays in the center of the screen. should work fine in all kinds of browsers.


Return to posts index

EJ5155Re: centering pages
by on Nov 12, 2006 at 2:21:03 am

Thanks for helping me out. I really appreciate it.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 All Rights Reserved