Author |
Message |
Shaun Dreclin
|
Posted: Sat Jun 10, 2006 2:31 pm Post subject: Centering a page vertically |
|
|
Well I know it should be simple, but I dont have any idea what the code is! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Shaun Dreclin
|
Posted: Sat Jun 10, 2006 2:32 pm Post subject: (No subject) |
|
|
Hmm... Maybe its something like valign center.. *goes to try that* |
|
|
|
|
|
wtd
|
Posted: Sat Jun 10, 2006 3:00 pm Post subject: (No subject) |
|
|
There is no reliable way to do it. |
|
|
|
|
|
rdrake
|
Posted: Sat Jun 10, 2006 3:10 pm Post subject: (No subject) |
|
|
Like wtd said, there's no real way to do it easily and effectively. You could use a bunch of <br /> tags, but then that doesn't work at all resolutions. You could use Javascript, but that too creates problems with many browsers. You could insert a table which covers the entire screen and add a | in there, but that's far from proper technique.
Honestly there's no easy way to do this, and it's not recommended you use one of the above techniques to do it either. |
|
|
|
|
|
[Gandalf]
|
Posted: Sat Jun 10, 2006 3:22 pm Post subject: (No subject) |
|
|
Just use a table and valign that. When your using plain HTML for anything more than an insignificant page it's almost impossible to write "proper" code.
^Advice from years of web development experience. |
|
|
|
|
|
Amailer
|
Posted: Sat Jun 10, 2006 6:16 pm Post subject: (No subject) |
|
|
won't
CSS: |
body {
margin-right: auto;
margin-left: auto;
}
|
work? |
|
|
|
|
|
md
|
Posted: Sat Jun 10, 2006 6:45 pm Post subject: (No subject) |
|
|
That does centering left/right (in some browsers... forget about most versions of IE). Vertical centering is rather difficult though. Fortunately it's almost always pointless... so unless you have a really reason it's not worth hacking together. |
|
|
|
|
|
|