Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Centering with CSS

Share this post!
 Vote this!

Back in the old days, if you wanted to center your whole (fixed size) page both horizontally and vertically in the browser window, you’d add an extra wrapper table, set its width and height to 100% and use the align and valign attributes on the single cell of that table to achieve the effect.

Then Web Standards were rediscovered.

To make modern browsers behave in a more predictable way they need a correct DOCTYPE. That will also make some of them refuse to make a table’s height 100%, since that was never part of the HTML specification (though widely accepted by browsers). So we can’t use the table trick anymore even if we wanted to mess up our neat, table free code.  More...

0 comments:

Post a Comment