Home arrow Style Sheets arrow Page 3 - Matching Columns for Fixed Web Page Layouts with CSS
STYLE SHEETS

Matching Columns for Fixed Web Page Layouts with CSS


If you're a web designer trying to learn how to build web page layouts where the main columns are displayed as completely balanced, then this group of articles might be what you need. Welcome to the second tutorial of the series that began with "Matching Web Page Columns with CSS." Over the course of this series, you'll learn a CSS-based approach which can be used to keep the length of your web page DIVs entirely level.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
July 23, 2007
TABLE OF CONTENTS:
  1. · Matching Columns for Fixed Web Page Layouts with CSS
  2. · Working with fixed web page layouts
  3. · Balancing the columns of a fixed web page
  4. · Building a fully-balanced fixed web page layout

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Matching Columns for Fixed Web Page Layouts with CSS - Balancing the columns of a fixed web page
(Page 3 of 4 )

As I said in the previous section, I'm going to fix the previous web page layout so that it shows its columns fully matched on the browser. 

The solution to this column-related issue, as you'll probably know, is based on redefining the generic "mainwrapper" DIV shown in the previous section so that it will wrap and position all the pertinent columns to the left and right sides of the web page. Quite simple, right?

Having explained that, here are definitions for the set of CSS styles that perform the aforementioned tasks:

#mainwrapper{
   clear: both;
   width: 800px;
   height: 100%;
   margin-left: auto;
   margin-right: auto;
   overflow: hidden;
   background: #eee;
}

#mainwrapper .leftcol{
   position: relative;
   float: left;
}

#mainwrapper .rightcol{
   position: relative;
   float: right;
}

See how easy it is to define a general containing DIV that makes the respective web page columns float to the left and right sides of the pertinent web document? At this stage, and having at our disposal such a useful piece of CSS code, the only steps required to match the columns of the web page are based on merging the previous styles with the respective structural markup into a unique (X)HTML file.

Do you want to see how the file looks after introducing the CSS styles? Jump ahead and read the next few lines. I'll be there, waiting for you.


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 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials