This is a discussion on "[SOLVED] Centering Vertically" within the Web Page Design section. This forum, and the thread "[SOLVED] Centering Vertically are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Centering Vertically
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Centering Vertically
Good Morning,
I am trying to center the body html vertically and horizantally. Thought it would have been very simple.
Cheers Dan |
|
|
|
||||
|
Re: Centering Vertically
Centering your site vertically is a pain in the butt.
I have never tried to center a website vertically but i have found an example here: http://www.wpdfd.com/editorial/thebox/deadcentre4.html. |
|
||||
|
Re: Centering Vertically
never tiried it before but look here, it seems to have the solution you are looking for, you can also look at W3C for an example
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
Re: Centering Vertically
Hi Dan,
the problem is, that you cannot change the size of the body element. The body element always represents the complete visible page. Instead you have to place a separate div inside the body. To get that div centered, try something like
|
|
|||
|
Re: Centering Vertically
hschmitz,
That has worked so much less code. If i was to change the height how would I know what measurements the others should change to, For example height to 600px. Cheers for this help everyone. Greatly apprieciated Daniel |
|
||||
|
Re: Centering Vertically
Basically for the margins (left & top), you need to half the widths and heights so: margin-top = -height / 2 margin-left = -width / 2 Hope that helps in future! Thread marked as solved! |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Centering horizontally and vertically | Emzi | Web Page Design | 4 | Nov 1st, 2007 16:07 |
| [SOLVED] Problems with centering in CSS. | mcdanielnc89 | Web Page Design | 26 | Nov 1st, 2007 06:07 |
| [SOLVED] Centering! | mcdanielnc89 | Web Page Design | 20 | Oct 21st, 2007 22:02 |
| Vertically centering Div's | verkevinmanering69err455 | Web Page Design | 3 | Mar 19th, 2007 17:22 |
| centering vertically | benbacardi | Web Page Design | 17 | May 27th, 2004 13:51 |