Style Sheets
  Home arrow Style Sheets arrow Using Auto Margins with Multiple Columns t...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Using Auto Margins with Multiple Columns to Center DIVs with CSS
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-16

    Table of Contents:
  • Using Auto Margins with Multiple Columns to Center DIVs with CSS
  • Building a centered web document layout with CSS auto-margins
  • Adding CSS styles to the previous (X)HTML page
  • Tying the CSS styles to the structural markup

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Auto Margins with Multiple Columns to Center DIVs with CSS


    (Page 1 of 4 )

    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.

    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!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This tutorial shows how to expand the use of CSS auto-margins, in order to build a...
     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek