This is a discussion on "centreing a whole page with layers" within the Web Page Design section. This forum, and the thread "centreing a whole page with layers are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
centreing a whole page with layers
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hi gang,
I know I should know this, but this late at night it's got me on a go slow. I've built a page in dreamweaver with layers (divs) and now I want the whole page to centre in the browser, but it wont do it. I have hand coded another div in the code
any suggestion would be very welcomed much appreciated (I'd rather not turn it into tables and cells, and it needs to work as a template with regions added to numerous pages, as it will be edited via contribute eventually) Last edited by Gerry; Aug 31st, 2007 at 23:33. Reason: last sentence added |
|
|
|
#2
|
||||
|
||||
|
Re: centreing a whole page with layers
this is css not html
why do you have a class and id defined for container you only need one
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#3
|
|||
|
|||
|
Re: centreing a whole page with layers
I don't think this will work if it's absolutely positioned. Absolute positioning (like all other positioning) takes the elements it is applied to out of the flow of the document. The thing is with absolute positioning is that it is just that, absolute. It won't move anywhere, that's the point.
Pete. |
|
#4
|
|||
|
|||
|
Re: centreing a whole page with layers
To make the layer centred on the page you need to put the text-align: center in the CSS of the body.
Quote:
|
|
#5
|
|||
|
|||
|
Re: centreing a whole page with layers
Dont need to text align anything centered!
You would need 2 wrappers. One being width:100%; and the other inside this being the width of the site and margin 0 auto (width:600px; margin:0 auto |
|
#6
|
|||
|
|||
|
Re: centreing a whole page with layers
You can't center an object if it has no width. Add a width and margin:0 auto; will work. And you certainly don't need to contain the div in another 100% wrapper. All you need is the container and then put everything in that.
The only reason you would need text-align:center; on the body is for IE 5.x as it won't read margin:0 auto; IE 5.x compatible.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Last edited by moojoo; Sep 4th, 2007 at 15:28. |
![]() |
| Tags |
| page, layers, centre, center |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Real problem centreing images in Firefox/Safari... | JamesHatter | Web Page Design | 2 | Apr 10th, 2008 15:14 |
| How to create a centered page with layers. | sgbrix | Web Page Design | 7 | Mar 11th, 2008 15:36 |
| Layers that go the entire Height of the page. | briandina | Web Page Design | 0 | Dec 31st, 2006 21:01 |
| Need help with layers | davidsnave | Web Page Design | 0 | Aug 29th, 2005 23:26 |
| Centering layers in a page | gwx03 | Web Page Design | 9 | Nov 26th, 2003 19:55 |