Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Centering a page vertically
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Shaun Dreclin




PostPosted: 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
Sponsor
sponsor
Shaun Dreclin




PostPosted: Sat Jun 10, 2006 2:32 pm   Post subject: (No subject)

Hmm... Maybe its something like valign center.. *goes to try that*
wtd




PostPosted: Sat Jun 10, 2006 3:00 pm   Post subject: (No subject)

There is no reliable way to do it.
rdrake




PostPosted: 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]




PostPosted: 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. Razz
Amailer




PostPosted: Sat Jun 10, 2006 6:16 pm   Post subject: (No subject)

won't
CSS:

body {
margin-right: auto;
margin-left: auto;
}

work?
md




PostPosted: 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.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: