Monday, April 20, 2009

CSS Layout technique #1: 3 Columns with Header and Footer

This is the most common form of CSS layout used on websites over the internet. This layout is best suited for websites with large content and advertising banners.
I have given a very easy to understand CSS layout technique to plan this layout. You can change a lot of parameters in here and modify it according to your needs.

3 Columns with Header and Footer

CSS Code:
.header {
    height: 100px;
    position: absolute;
    left: 10px;
    top: 10px;
    right: 10px;
    border-width: 1px;
    border-style: dashed;
    background-color: #C1C1C1;
}
.left_col {
    position: absolute;
    left:10px;
    top:120px;
    width:200px;
    height: 500px;
    border-width: 1px;
    border-style: dashed;
    background-color: #D6D6D6;
}
.center_col {
    margin-left: 220px;
    margin-right:220px;
    height: 500px;
    position: relative;
    border-width: 1px;
    border-style: dashed;
    background-color: #DFDFDF;
    margin-top: 120px;
}
.right_col {
    position: absolute;
    right:10px;
    top:120px;
    width:200px;
    height: 500px;
    border-width: 1px;
    border-style: dashed;
    background-color: #D6D6D6;
}
.footer {
    height: 100px;
    border-width: 1px;
    border-style: dashed;
    position: relative;
    margin: 10px;
    background-color: #C1C1C1;
}
.content {
    margin: 10px;
}
body,td,th {
    font-family: Verdana, Geneva, sans-serif;
    font-size: small;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}

HTML Code:
<div class="header">
<div class="content">Header Content</div>
</div>
<div class="left_col">
<div class="content">Left Column Content</div>
</div>
<div class="center_col">
<div class="content">Center Column Content</div>
</div>
<div class="right_col">
<div class="content">Right Column Content</div>
</div>
<div class="footer">
<div class="content">Footer Content</div>
</div>

This technique may have some bugs for older browsers but it works fine on all the new browsers.

Technorati Tags:

4 comments:

  1. mytectra placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance.

    ReplyDelete
  2. Guaranteed #1 Search Engine Ranking Supreme Free Viral Traffic Join Now Get Millions Of Hits Free To Your Site/Blog!

    PornKings Adult Shopping Backlinks-Shopping Mega Store Legendary Stars As Stormy Daniels,Shawna Edwards,Jenna Jamison-New Adult Stars Movies,Adult Toys,Enhancers,Merchandise-More !

    Hits Express Rotator System Do You Need Visitors to Your Website or Affiliate Program? If your looking to gain more visitors to your website Hits Express is your answer. With our program your site is being shown to people all over the world 24/7 365 days a year!

    PAYDIR Free For All Forum Portal Search Engine Crawled Network PR10 Ranking Information Forum XXX!

    FreeLinkExchanges Be Seen In 12 Nations 312 Sites Over 30 Millions Viewers Monthly Buy Featured Link Now With 150 Search Engines Crawling The Network!

    How do I get guaranteed traffic? When someone signs up from your site, they must first click on your classified ad which will open a new window leading to your main website. They will have to wait a few seconds for the code to appear on a separate frame at the top of the screen reach millions free now!

    Blast Your Ad to Over 23,000 Opt-in Prospects at ShowMyLinks Submit Your Solo Email Ad to All Showmylinks Members GET YOUR TEXT LINK ADs LISTED 100% FREE FOR LIFE PLUS EARN MONEY TO YOUR PAYPAL!!

    Adult Store Empires Backlinks Resources Search Engine XXX!

    GET YOUR OWN MONEY-MAKING AD BOARD -- Integrating Text ad, Banner Ad and Email Ad into one Portal Make Money Fast With Your Paypal Reach Million Dollars In A Year Fast !

    Full Length Homemade Videos Watch real people's private home sex videos. Forget about those shitty 1-2 minute clips, these are all high quality full length videos! 40+ Bonus Sites You will also get full access to the entire reelpass network of sites which features over 40+ awesome movie sites, 1000's of movies and pictures to download! Download, Burn & Share Not only do you get to watch all our movies, you can also download every single one and save it forever, burn them to dvd or share with friends!!

    ReplyDelete

Thanks a lot for your valuable comments :)