Centering Designs with CSS
One of the more frustrating aspects of CSS is centering our fixed designs effectively on the page. I know this because it’s a question people ask me quite often—and in fact the idea for this article came from a reader concerned about how to do just this.
While CSS offers a logical means to center designs, the problem is with browser implementation. No surprises there! It’s more than a bit frustrating because with table-based layouts this was a no-brainer. We’d simply use the align="”center”" attribute to center the containing table, and the entire layout would then be centered.
So how do we achieve the same effect in CSS? The good news is that we can. The bad news is that to center our content effectively, we have to employ a workaround in order to support multiple browsers. The good news is that the "hack" will display centered designs in all kinds of browsers, including Netscape 4.x, which is pretty cool.
Read More