
What is a fluid width page?
A fluid width page – or liquid – layout is one that shrinks and grows between two values of widths. For instance, a page might have a maximum width of 1280 pixels and a minimum width of 800 pixels.
Some clients or freelance website designers may want their page to grow or shrink with the browser window. Some think this is an outdated technique, but it is still used in several modern and large-scale designs. If an excessively long line-length is a problem, enclose blocks of text in a DIV element and specify a fixed width. If you find this useful or use a sight with a liquid or dynamic width layout, leave a comment with a link to your site at the bottom of this post.
Fluid CSS Layout Demo
– See the code in action.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>The Perfect Fluid CSS Layout</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="wrap">
<div id="inside">
<div id="header">Header</div>
<div id="left">Sidebar</div>
<div id="right">
<p>Lorem ipsum dolor </p>
</div>
<div id="footer">Footer</div>
</div>
</div>
</body>
</html>CSS Code:
Place this in a text file and name it style.css
*{margin:0;padding:0;} body { text-align:center; background-color: #cccccc; } #wrap { text-align:left; margin: 10px auto; min-width: 780px; max-width: 1260px; } #wrap #inside { margin: 10px 10px 0px 10px; padding-top: 10px; padding-bottom: 10px; } #header { background-color: blue; padding-top: 20px; padding-bottom: 20px; } #left { width: 150px; float: left; padding-left: 15px; padding-top: 20px; } #right { padding-left: 210px; padding-top: 20px; background: url('sidebar.png') repeat-y green; } #footer { background-color: red; padding-top: 20px; padding-bottom: 20px; }
The trick to making the left column appear to be fixed width is using an image that is a solid color filled with the color you want your left column to be.
2 Responses to How to create a fluid width 2-column CSS layout
Leave a Reply Cancel reply
post categories
- AJAX (2)
- css (2)
- freelance website design (16)
- graphics (4)
- javascript (4)
- photoshop (1)
- php/mysql (5)
- portfolio (2)
- resources (4)
- site info (2)
- social networking (1)
- tools (1)
- tutorials (8)
Limited time offer
As a limited time offer - thanks to a deal with Host Gator - Wildreason Productions is able to provide a basic 2-3 page webpage with a blog and custom logo for free. All you have to do is host your website at Host Gator as a new customer. Click here to signup or get more information about a free website!May 2012 M T W T F S S « Apr 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Tags
16x16 icon ajax backgrounds convert decimal convert fraction css css layout tutorial decimal to fraction desktop background dynamic width error reporting favicon favicon generator fixed width css fixed width layout fraction common denominator free backgrounds free favicon freelance website design graphics high resolution backgrounds image hover effect image rollover image transition invalid argument supplied foreach javascript javascript image transition liquid layout mootools mootools hover mootools transition effect networking online tool PHP png quote generator quotes resources runtime error simplify fraction social icon social networking tutorial wallpaper website designers




I don’t bookmark sites but i will bookmark this! LOL!
Being a new blogger, I would like to tell you that you have given me much knowledge about it. Thanks for everything.