3 Column Liquid Layout

3 Column Liquid LayoutA lot of people have wanted to make 3 column CSS layouts but have always managed to run into problems ... like I did the first time I tried. With this tutorial I hope to show you how you can overcome the problems of liquid layouts to create your very own liquid layout which will fit into the screen of the browser at any resolution.

First off, we are going to create the HTML for a layout which has;

  • A header.
  • Left column.
  • Middle column.
  • Right column.
  • And a footer.

The HTML for this would be;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<meta name="description" content="" />

<title>3 Column CSS liquid layout.</title>
</head>
<body>

<div id="wrapper">
<div id="header"></div>

<div id="left"></div>
<div id="middle"></div>
<div id="right"></div>

<div id="footer"></div>
</div>

</body>
</html>

This will give us our basic structure. The next thing we are going to add is our CSS styles;

<style type="text/css">
* {
padding: 0px;
margin: 0px;
}

#wrapper {
width: 100%;
}

#header {
width: 100%;
height: 200px;
background: lightgreen;
}

#left {
width: 20%;
height: 400px;
background: blue;
float: left;
}

#middle {
width: 60%;
height: 400px;
background: orange;
float: left;
left: 20%;
}

#right {
width: 20%;
height: 400px;
background: yellow;
float: left;
left: 80%;
}

#footer {
width: 100%;
height: 100px;
background: green;

clear: both;
}
</style>

The style marked with an asterix simply denotes that all tags within the page will all have their styles padding and margin set to 0px;. The #wrapper is simply a container for the entire site layout.

To view an example of the working 3 column css liquid layout click here.


Close    To Top
  • Prev Article-Web Design:
  • Next Article-Web Design:
  • Now: Tutorial for Web and Software Design > Web Design > HTMLCSS > Web Design Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction