Forum Moderators: open

Message Too Old, No Replies

Centering Layers in Frontpage 2003

Layers Frontpage 2003

         

sfx20

2:30 am on Sep 28, 2005 (gmt 0)

10+ Year Member



Hello All,

What is the easiest way to center layers on screen so that no matter what the screen resolution is all layers will be centered? I would prefer to use layers for page layout instead of tables. Is this a bad idea?

Cheers,

sfx

benihana

10:16 am on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



by layers, do you mean <div>'s?

If so, yes they are better to use (IMO) of course.

they can also be tricky to get cross browser consistency.

To center horzontally you need to use css like so:

body {
text-align:center;
}

#mainwrapper {
margin:0 auto;
}

Where your main wrapper <div> has an ID of mainwrapper.

the text-align:center; is for older versions of IE to centre the page, the

margin:0 auto;

is for good browsers.

Ben

sfx20

11:21 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



Hi Ben,

Thanks for your help. Can you tell me why using layers is better for page layout than tables? Or do you have any references that you could point me toward in order to help explain the reasons better?

Thanks again,

sfx

bill

9:03 am on Oct 4, 2005 (gmt 0)

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



Welcome to WebmasterWorld sfx20.

Search the forums. We have a ton of threads on this topic. Here's one to start you off: Should I go tableless or not? [webmasterworld.com] You'll probably have the best luck searching for CSS layouts [google.com] or tableless layouts [google.com].

sfx20

11:18 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



Thanks for your help, Bill. Much appreciated. :)