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.
|
|
|
|
|
![]() |
||
Centering layers in a page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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. |
|
|
|
|||
|
Use just one table to define the main areas of the whole page and save yourself a heap of trouble.
|
|
|||
|
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) |
|
|||
|
Can you please elaborate on how to do that in dreamweaver? I am new to CSS!
|
|
|||
|
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 |
|
|||
|
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?
|
|
|||
|
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.
|
|
|||
|
Gotta love layers and their incredible powers!
|
|
|||
|
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.
|
|
|||
|
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!!! |
![]() |
| Tags |
| centering, layers, page |
| Thread Tools | |
|
|
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 |