spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / authoring / style / sheets / css_mastery

[previous]

Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?


CSS Mastery: Page Layout

Three-column floated layout

The HTML needed to create a three-column layout is very similar to that used by the two-column layout, the only difference being the addition of two new divs inside the content div: one for the main content and one for the secondary content.

Using the same CSS as the two-column technique, you can float the main content left and the secondary content right, inside the already floated content div (see Figure 7-4). This essentially divides the second content column in two, creating your three-column effect.

Figure 7-4. Creating a three-column layout by dividing the content column into two columns
Figure 7-4. Creating a three-column layout by dividing the content column into two columns

As before, the CSS for this is very simple. You just set your desired widths and then float the main content left and the secondary content right:

You can tidy up the layout slightly by removing the padding from the content element and applying it to the content of the secondary content instead:

This leaves you with a nice and solid three-column layout (see Figure 7-5).

Figure 7-5. Three-column layout using floats
Figure 7-5. Three-column layout using floats

CSS Mastery: Advanced Web Standards Solutions


This content is excerpted from, "CSS Mastery: Advanced Web Standards Solutions", authored by Andy Budd with Cameron Moll and Simon Collison. The content represents pages 133 to 140, from the chapter, "Layout". The book is published by friends of ED, © copyright 2006 by Andy Budd, Cameron Moll, and Simon Collison. All rights reserved. Reprinted with permission. ISBN 1590596145).

home / authoring / style / sheets / css_mastery

[previous]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

URL: