CSS Quick Tip: Using Faux Column

The one of the most common questions that arises to web designers is how to extend the background color of a column to extend all the way down.

The concept is very simple. But first of all let me explain you the situation here. Consider the image below.

faux-layout-1You want both the columns to stretch down till the end equally unlike the above examples. The bad part in CSS is that the elements stretch only up to the size they require. For example a 600px image wrapped inside a div will make the div stretch only up to 600px

The Tip : Using Faux Columns

Well the secret of making those 2 columbns stretch down is simply mere. What we do is create a container wrapping both the divs with a backrgound image and repeating it vertically. Simple yet effective, isn’t it ?

Here is our image that we will be using in the background

faux-layout-2

The image, though some pixels tall, but when placed as a background and tiled vertically will create 2 columns. The above image will be the background on the main wrapper and the CSS for the element will be

background: #ccc url(../images/faux-column.gif) repeat-y 50% 0;

The 50% 0 refers to positioning of the background image, which in our case 50% means centering the image horizontally.

Conclusion

The concept is simple but many people wont be knowing it. If you liked it please do comment.

You might consider viewing the example here

Related posts:

  1. How to create Rounded Corners using CSS
  2. Free WordPress Theme – CNAspire
  3. Free WordPress Theme – WpTechTuts v1.0
  4. How to make complexion fair in Adobe Photoshop – Tutorial


The author is a small business owner himself specialising in Web Development. He runs Insight Studios which offers specialized Web Development, SEO Services and PPC Management for Small Business and SME thus ensuring growth and prosperity using the power of social media.

Share This Post

Related Articles

Leave a Reply

© 2012 MyGeekPal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Designed by Insight Studios