Creating a Three-Column Liquid Layout with a CSS Framework
Web-based frameworks are very popular these days. They provide programmers with a set of reusable components, usually packaged in the form of classes and functions, which allow them to build complex web applications very quickly and with minor efforts. In these tutorials you’ll find an approachable guide to how to build a simple CSS framework that will let you create some typical web page layouts in a very short time, using only a few basic style sheets.
Creating a Three-Column Liquid Layout with a CSS Framework - Coding a brand new CSS file (Page 3 of 4 )
If you found it easy to grasp how to use the previous CSS framework to build a two-column web page layout, then when I show you how to use it for creating one composed of three main bars, you’ll see that this process is even simpler.
Actually, providing the framework with the ability to render a layout like the one mentioned above is only a matter of coding a new CSS file that supports adding a right-placed column within a web document. Period.
However, this may sound a bit complicated if I don’t show you how this CSS file really looks. Therefore, I listed its signature below. Here it is:
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
color: #000;
margin: 0 0 18px 0;
}
As you can see, the above CSS file looks pretty similar to the one that I used in the previous section. Nonetheless, in this particular case it includes an additional “#rightbar” selector, which can be used for placing another column on the right side of a web document. Other than that, the other selectors and classes remain the same.
Of course, I could have merged this new file with the one that was utilized for constructing a two-column web page layout, but I decided to keep them separated, so you can grasp more quickly how they work. However, nothing stops you from doing this, if you want to avoid using an extra CSS file.
At this stage, I've explained how to incorporate an additional file into the existing ones that comprise this CSS framework, in this way providing it with the ability to easily construct three-column liquid layouts.
If you're like me, though, you’ll want to see how the file can be used in a concrete example. Therefore, in the last section of this tutorial I’ll be coding a new (X)HTML file, which will be tasked with using this brand new CSS file to display the aforementioned web page layout.
As usual, to learn the full details of this process, please go ahead and read the following section.