Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm sure an easy question - but I can't code HTML

Status
Not open for further replies.

whoknows361

Technical User
Sep 22, 2005
228
US
Im sure this is pretty easy - but how do I center my webpage so that any resolution/screen size will show the page in the middle of the browser? Thanks in advance.
 
Horizontal centering is pretty easy. Vertical centering is not, since there is no definite way to forcing an element to float in the vertical center of another element. More or less, your easiest option is to create a 100% wide 100% high table and put align to center and valign to middle on its only cell. And no doctype. If all this is worth one dead center element, then use it, I know it is not for me.
 
There are lots of techniques, but all of them useless if you can't code HTML. The "proper" way is to use CSS "margin: auto" for the top-level block element, which is usually the body tag.

Thomas D. Greer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top