CSS - Full-height 3-column Layout, Height Issues
Hello
Just recently I had an idea for a page I wanted to make, the design is basically a 3-column layout with no traditional header or footer, the height of all three columns should run the length of the window/page height the left and rightmost column would have a fixed width or a width in em, the center column width should fill the space in between. If the content is short all columns should extend to the height of the page window, but if the content in any of the columns is longer than the window height they should all extend to reach the bottom of the page and accommodate the content length In my first attempt things didn't go so well, results varied wildly across browsers so I decided to start from scratch bit by bit Bellow is the point at which I reach consistent but undesired behaviour, I have validated and tested the code in Firefox 3/Pale Moon, Internet Explorer 8, Chromium 9, and Opera 11 I would like the end result to work in the above browsers as well as IE7 if possible I should point out now that im not interested in using faux-columns, the layout should not require images, I also wish to have absolute-positioned elements in the columns some time later Code: <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Three Columns</title> <style type="text/css"> *, html, body { margin: 0; padding: 0; font-size: 100%; } html, body { width: 100%; height: 100%; } #maincontainer { position: relative; height: 100%; background: #eee; } #left { position: absolute; top: 0px; left: 0px; width: 200px; background: #fbb; height: 100%; } #mid { position: relative; margin: 0 200px 0 200px; background: #efe; height: 100%; } #right { position: absolute; top: 0px; right: 0px; width: 200px; background: #bbf; height: 100%; } </style> </head> <body> <div id="maincontainer"> <div id="left"> left start<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left<br /> left end<br /> </div> <div id="mid"> mid start<br /> mid<br /> mid<br /> mid<br /> mid<br /> mid<br /> mid end<br /> </div> <div id="right"> right start<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right<br /> right end<br /> </div> </div> </body> </html> In the above example it works as long as the content within the columns is shorter than the window height, but if you re-size the window so that the text in the right or left column goes beyond the page, and then scroll to the bottom, the columns do not extend to the bottom of the page so there is a large gap where the content overflows beyond the column What I would like to do from this point is make the columns extend to the bottom of the page when this happens, but I'm not sure how best to proceed I also have a version of the above code which uses floated left and right columns instead of absolute positioned ones, would it be better to work from that? or does it not really matter Thanks in advance Similar TutorialsThis seems like it should be very easy to do but something is preventing it from working. I was following the guide at http://www.alistapart.com/articles/negativemargins but with my navigation column on the left. A summary of my layout right now is: <div id="wrapper"> <div id="container"> <div id="content"> </div> </div> <div id="navigation" <div id="navlist"> </div> </div> <div id="clearing"> </div> </div> my css: #container { float: right; margin-left: -16.8em; width: 100%; background-color: #2586d7; } #navigation { float: left; width: 14em; background: #90bade url(navimage.jpg) repeat-y: right; } #wrapper { background: #90bade url(navimage.jpg) repeat-y: right; } #navlist is a div containing a styled ul for navigation. #clearing { clear: both; height: 0; } So basically the navigation div is supposed to extend to the bottom as far as the container div goes. According to the guide at AListApart it should be working but is something else in my code interfereing? If everything above should work fine, I can post a link to the test file so you can see the rest of the code. Thanks for any help! Hi, I have a border around the content of my page which is limited in width but not height. Some of the pages have more content then others so the height adjusts. I also have a left column and a black background with and image in this column but I have 2 problems 1. In IE I can't seem to get this black column(div) to extend to the full height of the column so that it reaches the border. 2. In Firefox this left column extends all the way down the page and the border doesn't surround the text it sort of collapses The column is left floated and in a div and the content is right floated and in a div as well which is all surrounded by a div with a border. I would appreciate any help that you might offer. Thanks I am looking for some examples on making this layout: ----------HEADER---------- nav content - - - - - - - - - - - - ----------FOOTER0--------- The page needs to be 100% the height of the browser window with header at top, footer at bottom and the content/nav being a minimum height of enough to fill the screen vertically and should be expandable. Anyone got any pointers? Having coded using tables for the past 5 years, I'm coding my first site using pure CSS (hold back the laughter) ... I'm new to change. In any case ... I'm attempting to setup a homepage that has a fixed width and height. So far I've got a one-column header working fine. Beneath the one-column header I wish to have three columns with--dare I say it Web 2.0ish rounded corner cells--However the caveat is that these three cells need to all be a fixed height to go along with the page design. After two days of research, coffee, banging my head against my desk, I haven't been able to figure this one out. I am using an image at the top of each cell and an image at the bottom of each cell, but cannot get the cells to maintain a specific height. Any help would be appreciated: CSS: Code: /*<agl.folder "general">*/ body { color: #000; font 76%/1.5em "Lucida Grande", Verdana, Geneva, Helvetica, sans-serif; margin: 0; padding: 0; } .footer { color: #7f7f7f; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; text-align: center; } .footer a:link { color: #7f7f7f; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; text-align: center; } .footer a:visited { color: #7f7f7f; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; text-align: center; } .footer a:hover { color: #8da7fb; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; text-align: center; } .user_links a:link { color: #7f7f7f; font-size: 14px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .user_links a:visited { color: #7f7f7f; font-size: 14px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .user_links a:hover { color: #8da7fb; font-size: 14px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .text { color: #000; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .text a:link { color: #7f7f7f; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .text a:visited { color: #7f7f7f; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } .text a:hover { color: #8da7fb; font-size: 12px; font-family: Helvetica, Geneva, Arial, SunSans-Regular, sans-serif; text-decoration: none; } a:link { color: #7f7f7f; text-decoration: none; } a:visited { color: #7f7f7f; } a:hover { color: #8da7fb; text-decoration: none; } /*</agl.folder>*/ #frame { width: 965px; margin: 0 auto; } #header { background-color: #fff; max-width: 965px; margin-top: 10px; } #content { position: relative; max-width: 965px; height: 200px; } #footer { background-color: #fff; position: absolute; top: 265px; width: 965px; } /*<agl.folder "box">*/ #portfolio { position: absolute; left: 0px; top: 0px; width: 475px; height: 200px; } .portbox { background-color: #ffffff; border: solid 1px #b6b6b6; padding: 4px; } .portbox:before { content: url(../images/homepage/portfolio.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } .portbox:after{ content: url(../images/homepage/portfolio_bottom.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } /*</agl.folder>*/ /*<agl.folder "methodologies">*/ #methodology { position: absolute; left: 482px; top: 0; width: 237px; height: 200px; } .methbox { background-color: #ffffff; max-height: 200px; border: solid 1px #b6b6b6; padding: 4px; } .methbox:before { content: url(../images/homepage/methodology.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } .methbox:after{ height: 200px; content: url(../images/homepage/meth_bottom.png); display: table-row; margin: -5px; } /*</agl.folder>*/ /*<agl.folder "design">*/ #design { position: absolute; left: 726px; top: 0px; width: 235px; height: 125px; } .designbox { background-color: #ffffff; border: 1px solid #b6b6b6; padding: 4px; } .designbox:before { content: url(../images/homepage/design.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } .designbox:after{ content: url(../images/homepage/design_bottom.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } /*</agl.folder>*/ /*<agl.folder "solutions">*/ #solutions { position: absolute; left: 726px; top: 135px; width: 235px; height: 125px; } .solutionsbox { background-color: #ffffff; border: 1px solid #b6b6b6; padding: 4px; } .solutionsbox:before { content: url(../images/homepage/solutions.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } .solutionsbox:after{ content: url(../images/homepage/design_bottom.png); display: block; line-height: 0.1; margin: -5px -5px -5px; } /*</agl.folder>*/ h2 { font-size: 1.5em; font-weight: bold; } HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title>Test CSS</title> <link href="css/home_layout.css" rel="stylesheet" type="text/css" media="all" /> </head> <body> <div id="frame"> <div id="header"> <p align="right"><span class="user_links"><a href="(EmptyReference!)">Login</a> | <a href="(EmptyReference!)">Register</a> | <a href="(EmptyReference!)">Contact</a></span></p> <img src="images/tabs.jpg" alt="" height="43" width="965" border="0" vspace="3" livesrc="images/tabs.psd" /><img src="images/homepage/flash_header.jpg" alt="" height="275" width="965" border="0" vspace="5"/><br /> </div> <div id="content"> <div id="portfolio"> <div class="portbox"> <p align="center"><img src="images/homepage/screenshots.jpg" usemap="#screenshotsc1fd8d76" livesrc="images/homepage/screenshots.psd" alt="" height="137" width="426" / border="0"><map name="screenshotsc1fd8d76"><area shape="rect" coords="290,9,418,129" href="http://www.pilatesmovementnyc.com" alt="Fitness Center Pilates New York City" target="_blank" /><area shape="rect" coords="146,9,281,129" href="http://www.emmestyle.com" alt="Emme Super Model" target="_blank" /><area title="Healthy Living NYC" shape="rect" coords="3,11,130,132" href="http://www.healthylivingnyc.com" alt="Healty Lliving NYC" target="_blank" /></map></p> </div> </div> <div id="methodology"> <div class="methbox"> <p><img src="(EmptyReference!)" alt="" height="36" width="36" align="left" border="0" csnew="csnew" cssot="ps" livesrc="(EmptyReference!)" /><span class="text">Step one is the first step in this whole thing ok. so don't start yet until you know what the first step is</span><br /> <img src="(EmptyReference!)" alt="" height="36" width="36" align="left" border="0" csnew="csnew" cssot="ps" livesrc="(EmptyReference!)" /><span class="text">Step one is the first step in this whole thing ok. so don't start yet until you know what the first step is</span><br /> <img src="(EmptyReference!)" alt="" height="36" width="36" align="left" border="0" csnew="csnew" cssot="ps" livesrc="(EmptyReference!)" /><span class="text">Step one is the first step in this whole thing ok. so don't start yet until you know what the first step i</span>s<br /> <img src="(EmptyReference!)" alt="" height="36" width="36" align="left" border="0" csnew="csnew" cssot="ps" livesrc="(EmptyReference!)" /><span class="text">Step one is the first step in this whole thing ok. so don't start yet until you know what the first step is</span></p> </div> </div> <div id="design"> <div class="designbox"> <p></p> </div> </div> <div id="solutions"> <div class="solutionsbox"> <p></p> </div> </div> <div id="footer"> <div class="footer"> <a href="(EmptyReference!)">Home</a> | <a href="(EmptyReference!)">Portfolio</a> | <a href="(EmptyReference!)">Web</a> | <a href="(EmptyReference!)">Marketing</a> | <a href="(EmptyReference!)">Advertising</a> | <a href="(EmptyReference!)">Identity</a> | <a href="(EmptyReference!)">Hosting</a> | <a href="(EmptyReference!)">Profile</a><br> <a href="(EmptyReference!)">Design</a> | <a href="(EmptyReference!)">Technology</a> | <a href="(EmptyReference!)">Business Solutions</a><br> <a href="(EmptyReference!)">Contact Us</a> | L<a href="(EmptyReference!)">ogin to Your Account</a><br> Copyright 2007 Website Development Enterprises, LLc </div> </div> </div> </div> </body> </html> Hi, I have a multi-column layout where I want every column to always be the same height. Any one of the columns may be the longest on any given page, so the other columns have to automatically adjust to match that height. Usually I'd just use the faux column technique where you repeat a background image, but that won't work because of two elements on this page: 1. each column has a border all the way around it. 2. one column resizes with the page. I've read the articles on liquid layouts with faux columns, but as far as I can tell those techniques won't work if your columns have borders. Does anyone know any technique that would work here? Thanks. Hi all! After trying more then a few things I'm about to give up, so I hope someone here has the answer. The problem is the following: * A website contains 3 DIV columns and an header at the top, this is all inside a single wrapper DIV which centers the webpage. * All three columns should have the same length as the longest column. * When the content in the 3 DIV columns is shorter then the height of your browser window, the DIV elements should fill-out until the bottom of the screen. Point 2 is doable. Point 3 is doable. But the combination of point 2 and 3 seems quite hard. Hope someone has an idea . Thanks! Hi, I am trying to better understand how column heights are displayed, and how to create full height columns. On this page http://tapmeister.com/layout_test/index.html, the column which drives the height of the page is <div id="main">, and the left and right columns do not span the entire column height, and the red <div id="content"> shows at the bottom of both side columns. On this page http://tapmeister.com/layout_test/index2.html, I put less stuff in the center <div id="main"> so it wouldn't drive the height of the page. The green <div id="main">, however, did cover the entire column unlike the left and right column on the earlier page. Can anyone help me understand what is going on, and why one column has full height color yet not the other one? Also, what is the best way to make the left and right column have full height color? I know I can apply a repeating background graphic to <div id="content"> which mimics the appearance of the left and right column, however, it would be nice to do differently if possible. My code is listed below (sorry about the ugly colors!) Thanks Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Layout Test</title> <style type="text/css"> * {margin: 0; padding: 0;} body {background-color: olive;} #wrapper { width: 100%; background-color: blue; margin: auto; } #main { margin: 0 180px; background-color: green; } #content {background-color: red;} #side1 { width:180px; float:left; background-color:yellow; } #side2 { width: 180px; float:right; background-color:yellow;} #footer { clear:both; background-color:lime; border-top: 10px solid black; } #header {background-color: purple;} .clear { clear:both; } </style> </head> <body id="page_bg"> <div id="wrapper"> <div id="header">My Header</div> <div id="content"> <div id="side2"> <p>Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here. Right Column go here.</p> </div> <div id="side1"> <p>Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here. Left Column go here.</p> </div> <div id="main"> <p>Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff. Some stuff.</p> <p><img style="margin: 5px; float: left; width: 250px;" src="lady.jpg" alt="" width="250"></p> <p>Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff. Some More Stuff.</p> <div class="clear"></div> </div> </div> </div> <div id="footer">My Footer</div> </body> </html> I have 2 div columns on a web page, they are positioned using css... the right column is taller than the left column, but the left column does not expand to the full height of the right column... I require this, because the left column has a background color that I want to go right to the bottom of the page. I have height: 100%; in the css style for the left column, but that only makes it 1 screen high... does anyone know of a way to make it the full height of the other column, ie stretch? I have tried height: auto; but that doesnt work either. Ok I've got this... Code: <html> <head> <style type="text/css"> body { height: 100%; background-color: blue; margin: 0px; padding: 0px; } .container { height: 100%; width: 300px; margin: 90px auto 50px auto; background-color: green; } .footer { position: absolute; bottom: 0%; width: 100%; background-color: yellow; height: 50px; } .menubar { position: absolute; top: 0px; width: 100%; background-color: red; height: 95px; } </style> </head> <body> <div class="menubar"> MENUBAR </div> <div class="container"> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br> a<br>a<br>a<br>a<br>a<br>a<br>z<br> <!-- footer --> <div class="footer"> FOOTER </div> </div> </body> </html> Which works beautifully in opera, the green part is the full size of the document with all those a<br> in there (or without), and the footer is perfectly placed at the bottom. But both IE (testing on version 6) & NS (testing on version 7.1) display the footer at the bottom of the window when it loads, not after the container div is finished... Also in NS the container divs background colour finishes once you scroll down a little. Now I've tried many different ways around this. I know what its like when I spend too long looking at one thing, I end up missing the obvious - so I thought I'd throw it out to a wider group for observations... I thank you in advance. -D Hello, In CSS is there a way to tell an object to extend the full height and width of its parameters without specifying height and using absolute positioning? Thanks, Andy I'd like to make a 2-column layout where each column fills the height of the container div, and the container div's height is determined by the longest div within it... this is getting a bit confusing, because I can't have one being determined by the other one with that one being determined by the first, if that makes sense? Any help would be greatly appreciated, thanks Hey I am developing a site for our band, and I'm having trouble getting the nav bar to look right. The page is http://www.mattbray.curvedspaces.co..._beta/index.php and I don't want the left hand section to stop halfway down the page. The stylesheet is called style.css in the same directory. Code: /* page defaults */ body { margin: 0px; padding: 0px; text-align:center; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #EAEAEA; } /* Layout divs */ #container { font-family: Verdana, Arial, Helvetica, sans-serif; color: #666666; position: static; left: 40px; top: 12px; padding: 0px; width: 800px; border-right: #003366 1px solid; border-left: #003366 1px solid; margin-right: auto; margin-left: auto; height: auto; text-align:left; background-color: #FFFFFF; } #title { background-image: url(images/saved_title.gif); margin-top: 10px; background-repeat: no-repeat; height: 150px; border-top-color: #000000; border-top-style: solid; border-top-width: 1px; border-bottom-color: #000000; border-bottom-style: solid; border-bottom-width: 1px; border-color: #000000; } #navbar { background-image: url(images/navbar.gif); background-repeat: no-repeat; border-bottom-color: #000000; border-bottom-style: solid; border-bottom-width: 1px; padding: 5px; height: 20px; font-family: Verdana, Arial, Helvetica, sans-serif; } #navwin { font-family: Verdana, Arial, Helvetica, sans-serif; border-right: 1px solid black; padding: 5px; background-color: #CCCFFF; width: 230px; height: 100%; margin: 0; float: left; font-size: medium; } #content { float: left; font-family: Verdana, Arial, Helvetica, sans-serif; padding: 10px; padding-top: 40px; background-image: url(images/content.gif); background-repeat: no-repeat; background-position: -239px 0px; background-color: #FFFFFF; height: auto; width: 539px; } #footer { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #CCCCCC; margin-bottom: 10px; padding: 10px; border-top: solid 1px black; border-bottom: solid 1px black; width: 780px; height: 25px; text-align: center; } /* Links */ a:link { color: #006699; } a:visited { color: #006699; } a:hover { color: #006699; text-decoration: none; } a:active { color: #006699; } /* elements */ #navwin h2 { font-size: large; display: block; } #navwin ul {} thanks Matt can i make my left column, the same height as my right column? or infact, if the left is taller than the right, the right extends to it and if the right is taller than the left the left extends to it? is this possible, cheers heres my css: left column, is #leftNav and the right column is #contentMain PHP Code: #content { margin:0px auto; padding: 0; width: 760px; } #contentMain { padding: 0; margin: 0; float: right; width: 632px; } #leftNav { color: #000; float: left; margin: 0; padding: 0; width: 128px; } I cannot figure this out. I've tried adding clear: both in several places, I've tried overflow: hidden and I've tried cursing. Nothing works! How can this be fixed so that in IE6 the divs are not staggered vertically?? Code: <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="38" border="0"></div> <div style="float: right; height: 38px; width: 102px;">copy</a><br>copy</a></div> </div> <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="19" border="0"></div> <div style="float: right; height: 38px; width: 102px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="8" border="0"></div> </div> I have a css layout in which I cannot get the height of my columns to extend correctly. If I declare a height, then that fixex the height temporarly until I enter more text then the column will overlap the footer. I have tried using the clear left and clear right for both columns but that doesn't work either. Would anyone mind looking over my code too see what I'm doing wrong. Here is the code: Code: <body> <div id="topper"> <div> <a href="">Header</a> </div> </div> <div id="contentHolder"> <div id="wideBox"> <div id="mainBox"> <div id="frame" class="homeFrame"> <img src="i/home.jpg" alt="Park Hill Christian Church" /> </div> <div id="nav"> <p><a href="">Menu 1</a> <a href="">Menu 2</a> <a href="">Education</a> <a href="">Menu 3</a> <a href="">Menu 4</a> <a href="">Menu 5</a> <a href="">Menu 6</a></p> </div> <div id="right"> Column Right </div> <div id="lineBacker"> <div id="content" class="homeContent"> <h1>Welcome!</h1> <p>Body Content</p> </div> </div> </div> </div> <div id="footer"> <p>Footer</p> </div> </div> </body> Code: body { position: relative; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #940609; } a { text-decoration: none; } img { border: 0; } /* MAIN DIV STYLES */ #topper { width: 100%; background-color: #FFFFFF; } #topper div { width: 705px; margin: 0 auto 0 auto; color: #940609; text-align: right; padding: 5px 0 5px 0; } #topper div a, #topper div a:visited { color: #940609; } #contentHolder { position: relative; width: 100%; } #wideBox { position: relative; width: 100%; border-top: 10px solid black; background-color: #BD2A2F; } #mainBox { position: relative; width: 725px; margin: 0 auto 0 auto; border-left: 10px solid black; border-right: 10px solid black; background-color: #000; } #frame { border-right: 10px solid black; float: left; background-color: #000000; } .homeFrame { width: 188px; } #nav { float: right; width: 507px; padding: 0px 10px 0px 10px; border-bottom: 10px solid black; background-color: #FFF; clear:right; } #nav a, #nav a:visited { color: #000; padding: 3px; font-size: 13px; } #nav a:hover { color: #940609; } #right { float: right; width: 180px; text-align: center; padding: 5px; background-color: #D6B569; } #right h3 { color: white; font-size: 20px; margin-top: -2px; } #right a, a:visited, { font-weight: bold; color: black; } #right p{ font-size: 10px; margin-bottom: -5px; } #lineBacker { margin-left: 198px; background-color: #D6B569; } #content { background-color: #FFFFFF; padding: 15px; margin-right: 200px; } #content p, img{ float: right; } #footer { width: 100%; border-top: 10px solid black; text-align: right; background-color: #940609; } #footer p { width: 700px; margin: 5px auto 20px auto; color: #FFFFFF; } #footer a, #footer a:visited { color: #FFFFFF; } /* INNER STYLES */ h1 { color: #940609; font-family: Times, Times New Roman, Garamond, serif; font-weight: normal; font-size: 28px; } I think problem lies within the #content id because if I set a height or min-height that will solve the problem temporarly. If anyone could look at this I would be very grateful. Thanks, Teamhonda81 Everyone complains about trying to get percentage column widths and fluid lengths in CSS but I've got problems with percentage height. My CSS and HTML are below. What I want to do is make sure the footer is always at the bottom of my page (with no scroll bars) and adjust the boxes in the right column to fill the height between the header and the footer using percentages. The main reason for this is I don't want a gap at the bottom of my rightside boxes and ths page will be viewed on unusual ratio screens with varying height. I may also possible need to use borders between my boxes and the content so could you also tell me if this is a problem. Thanks guys - Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Lilliput</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="lillicss.css" </head> <body> <div id="container"> <div id="menu">Menu </div> <div id="header">Header </div> <div id="wrapper"> <div id="content">Main Content </div> </div> <div id="calendar">Calendar </div> <div id="pagetools">Page Tools </div> <div id="alertbox">Alertbox </div> <div id="footer"><p>Page Footer</p> </div> </div> </body> </html> Code: html,body { margin:0; padding:0 } body { font: 76% arial,sans-serif } p { margin:0 10px 10px } a { display:block; color: #981793; padding:10px } #header { height:20px; margin:0; background: #CC0000; } #content p { line-height:1.4 } #footer p { margin:0; padding:5px 10px } #wrapper { float:left; width:100%; margin-left:-200px; } #content { margin-left:200px; } #calendar { float:right; width:200px; background:#000099; } #pagetools { float:right; clear:right; background:#0000FF; width:200px; } #alertbox { float:right; clear:right; background:#6600FF; width:200px; } #footer { clear:both; width:100%; background: #336699; color: #FFF; margin-bottom 0px } #container { width: 100%; height: 100%; } #menu { height:20px; margin:0; background:#CC6633; } I cannot figure out what's going on with my site. The white background box does not have the height of 100%. I was working but I changed something to get the columns to line up right for IE. Can anyone help.... beachweeklive.org Please look at this layout as provided by my graphic designer: http://hometown.tmhdesign.com/default.jpg Now look at my attempt to achieve the same http://hometown.tmhdesign.com I am a bit challenged at the right column and how to lay it out. She put a fixed height gradient background in the right div and then placed yet another div on top of that one. THe issue as you can see is if the content on the left exceeds the content on the right the design breaks up (so to speak). I'm really curious to get some feedback from the experts... Hi guys, I am struggling a bit with getting the background of one of my css-created columns to be the height I want it to be. If you have a look at http://www.addictivemedia.com.au/clients/REW/ you will see (depending on your browser) that the left column behaves not the way I want it to: - in IE 6 it creates an additional scrollbar (because it adds the height of the banner at the top to the 100% height I gave to the column) - in all other browsers it is not as long as the column on the right The effect I want to achieve is of course for both columns to have the same height and (if possible) to always push the footer to the bottom of the browser window. I have tried the pushing to the bottom many times and out of previous posts I gather that it probably won't happen for all browsers. But I cannot figure out why the left column doesn't extend as far as the right one. Thanks for your help! I have a brand new site going, and I am having a bit of trouble with the left hand column in IE. It all looks fine as long as the content doesn't take up more space than the height of the banner (I have a skyscraper ad there, nothing else). It's also ok in Firefox, Chrome, etc. But in Internet Explorer, the left hand column refuses to stretch down to the bottom if there is a lot of content, despite being set to 100% height, and I don't know how to fix it. I'm not sure what to do about this. I'm certain the code is... unconventional. But it works, aside from IE... I'd really like to explain this better, but I can't post links to show screenshots or anything. the site is comicnex(dot)us I mean, basically, there is a header comprised of 2 boxes, a large one with the header graphic and a twitter box, and a narrow one with a navigation buttons. a narrow column to the left, the content to the right, and a footer at the bottom. The problem arises when the content box gets too full, then the side bar doesn't stretch. *edit - I just discovered another problem in IE. again, I'd show screenshots of what is going on if I could. Basically, if you make the browser narrow, the left column moves to the right, and covers up content in the content area. Again, only in IE. I don't know how to explain it better than that, you'll just have to type in the URL and see it while using IE. |