There appears to be many ways to horizontally center a page:
1) The "David Walsh" method. This places all the css in the wrapper div.
Here is the link to the full article: http://davidwalsh.name/horizontally-center-website-structure-css
2) The "simple bits" method. This method centers the body tag and uses the div to left align the content. Here is the link to the full article: http://simplebits.com/notebook/2004/09/08/centering/
I am more of a developer type so I am not sure which way is better but I always use method 2.
I look forward to your comments on which method is better and why.
On a side note, if you look at the David Walsh article, someone made a good comment on making height 100% on the html tag so you always get the scroll bar. Rory Tatum showed me this years ago. Its a good tip for those starting out with css.
html
{
height: 100%;
margin-bottom: 0.01em;
}
I highly recommend checking out some of the other blog articles on both blogs mentioned above. There are some great tips and tricks found there.
If you come across any articles, tips, tricks, or resources please email Susan Fischer at Susan@clinchportal.com and we will post them here.
No comments:
Post a Comment