Centering layers in a page

This is a discussion on "Centering layers in a page" within the Web Page Design section. This forum, and the thread "Centering layers in a page are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 25th, 2003, 12:12
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
Centering layers in a page

Does anyone know how I can center a layer in a page in dreamweaver's design view mode?

Catalyst posted this earlier :
"to center a layer give it a width and set margin-left and margin-right to auto.

IE has problems with that though and it'll only work in IE6 in strict mode. You can avoid that by wrapping your layer in a DIV or SPAN with text-align set to center."

I know that the CSS property L(left) is the distance from the left side of the page body to the left edge of the layer while T(top) is the dist. from top edge of page body to the to top edge of the layer.

Hmm... I'm getting one of those supercharged spells again... Please correct me if I'm wrong. ok heres it. First, I create a layer for the WHOLE PAGE. After creating that, I use another nested layer and use the nested layer's L and T property ( since L and T can mean distance to parent layer ) to allocate its position ; That would mean that if the parent layer is moved, then the nested layers will also be moved, and equally and uniformly!!!! hrmm. the problem now, if this is right.. would be to center the parent layer. any ideaz?

If I got it wrong, PLEASE tell me the right way. I'm new to CSS and Layers. I've just switched over from the table design world.

  #2 (permalink)  
Old Nov 25th, 2003, 12:49
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Use just one table to define the main areas of the whole page and save yourself a heap of trouble.
  #3 (permalink)  
Old Nov 25th, 2003, 16:24
Junior Member
Join Date: Nov 2003
Location: United Kingdom
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Using one big table tends to make pages pause and appear.

If you nest more tables inside one big table, some browsers simply wont display anything until they have loaded everything inside that table which can make the site appear to stall.

I would suggest creating a style as below and then creat a DIV tag with this as the style

#container {
width: 760px;
border: 1px solid #000066;
margin-left: auto;
margin-right: auto;
padding: 0px;
}

Then put your code inside that. Should be pretty consisent across browsers.

(For some reason the Forum 'code' tag won't work)
  #4 (permalink)  
Old Nov 26th, 2003, 01:45
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
Can you please elaborate on how to do that in dreamweaver? I am new to CSS!
  #5 (permalink)  
Old Nov 26th, 2003, 05:29
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
margin-left: auto with margin-right: auto doesn't work in IE other than in version 6 and only in strict mode.

See this post
  #6 (permalink)  
Old Nov 26th, 2003, 07:25
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
it doesn't work on my IE 6.0 browser.. how do I set the property and what is the syntax? Can u plz give example?
  #7 (permalink)  
Old Nov 26th, 2003, 07:47
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, I am going to send you a file that will explain it all... As a matter of fact, according to Ethan Watrall, you can't center a layer... All you can do with it is make it the full size 800x600 and then use Visibility to play around with what is visible on the browser... You have 4 different fields to fill in. L<- This will hide everything on your layer starting from the left pixel and working to the number you specified. T<- same thing but works from Top to bottom. R<- This will Show you how ever many pixels you specify from the left and hide everything else after that. , B<- same thing again but works from top to bottom. Like I said, I will show you the File that I got all this from.. Talk to you then.
  #8 (permalink)  
Old Nov 26th, 2003, 08:34
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Gotta love layers and their incredible powers!
  #9 (permalink)  
Old Nov 26th, 2003, 19:14
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
OK, I messed with this some and at some point had to include a table to get it working correctly. So, my advice is use a table when needed but use CSS for as much else as you can.
  #10 (permalink)  
Old Nov 26th, 2003, 19:55
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah I have found Tables to be much better use for just about anything over CSS. Better Cross Browser support and all.. But I have found Using tables and CSS is a great way to go. ALthough MOzilla doesn't accept this technique (go figure) it is still accepted in Opera, IE, Netscape(which Mozilla is basically a version of...), and thats all I know for fact. Just play around with it, you learn more that way than any other way.

There's no fat lady, what should we do?? It has to end!!! HAVE no fear, Kulegamr is here! LA LA LA LA LA LA LA.... Yay!!! I can't believe it.. A fat man sang to end it.. What an ending!!!
Closed Thread

Tags
centering, layers, page

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a centered page with layers. sgbrix Web Page Design 7 Mar 11th, 2008 15:36
Centering a Page In CSS britishchampion Web Page Design 5 Jan 3rd, 2008 16:20
centreing a whole page with layers Gerry Web Page Design 5 Sep 4th, 2007 15:25
Layers that go the entire Height of the page. briandina Web Page Design 0 Dec 31st, 2006 21:01
Centering multiple layers technosponge Web Page Design 2 Jan 19th, 2006 17:48


All times are GMT. The time now is 02:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43