Home arrow Style Sheets arrow Using Auto Margins with Multiple Columns to Center DIVs with CSS
STYLE SHEETS

Using Auto Margins with Multiple Columns to Center DIVs with CSS


You may think that building centered web page layouts with CSS is an annoying experience, but guess what? This article series just might prove you wrong. It explains several CSS-based methods that you can use for constructing these kinds of designs very quickly, which should put a big smile in your face as soon as you start working with them. This article, the fifth one in the seven-part series, expands our use of the auto margin.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
April 16, 2009
TABLE OF CONTENTS:
  1. · Using Auto Margins with Multiple Columns to Center DIVs with CSS
  2. · Building a centered web document layout with CSS auto-margins
  3. · Adding CSS styles to the previous (X)HTML page
  4. · Tying the CSS styles to the structural markup

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Using Auto Margins with Multiple Columns to Center DIVs with CSS
(Page 1 of 4 )

Introduction

It's extremely easy to construct centered web documents by means of only a few simple CSS styles and basic markup. Surprisingly, they'll be rendered fairly consistently by most modern browsers -- yes, in this case, Internet Explorer isn't so sadistic as it usually seems to be. Best of all, you'll enjoy the copious code samples I've provided in this series of articles to walk you through creating a number of web page designs using some popular DIV-centering techniques.

And now that you've been introduced to the subject of this group of articles, it's time to quickly summarize the topics that were discussed in the last tutorial. In that article, I demonstrated how to build a centered, liquid web document design with the help of CSS auto-margins.

Basically, this approach is based on assigning a value of "auto" for the left and right margins of a selected DIV, positioning it right at the center of an HTML page. Simple, and quite effective too.

Though, as you'll surely recall, we used auto-margins in conjunction with a sample web document built to the "classical" form: a header and footer sections, and a single main column. It should be fairly instructive, therefore, to see how to use this same approach when working with a more complex document.

Thus, in this fifth installment of the series I'll be discussing how to build a centered web page layout using a multi-column design. So, are you ready to learn how this will be achieved? Then, jump ahead and start reading now!


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials