spacer

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

home / authoring / style / sheets / css_mastery

[previous]

C/C++ Developer (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Eclipse Helios Update Brings New PHP Tools
Internet Explorer 9 Ups Standards Support
JBoss Portal 5 Release Easier to Use


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]

webref The latest from WebReference.com Browse >
Flashmaps' DynamicLocator: Interactive Maps for Small Areas · Flashmaps' AreaSelector: Interactive Maps for Wide Areas · The DB Mapper: Interactive Street-level Maps of U.S. and Canada
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags

URL: