Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    Making the DIVs in a 3 column layout to be the same height

    Hi guys!

    I just thought about this, and I can't find out how I would archive it?

    I have a 3 column layout with header and footer. I use the first DIV for my menu, middle DIV as my main window (where I write all the text etc) and the last one for nothing. But when I write text that's really long in the middle div , the div will of course expand further down beyond the 2 other divs. How would I make the 2 other divs automaticly follow the one in the middle?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    I recommend you to have a look at

    http://bonrouge.com/3c-hf-fixed.php

    http://bonrouge.com/3c-hf-fluid.php

    and try to adopt one of them!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Like many others I have some basic templates, this is my 3 column if that's of any use.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>3 columns with header &amp; footer layout</title>
    <style type="text/css">
    * {
    margin: 0;
    padding: 0;
    }
    body {
    margin-bottom: 40px;
    }
    #wrapper {
    margin: 0 auto;
    margin-top: 15px;
    width: 900px;
    border: 1px solid #777;
    color: #444;
    background: #fff;
    }
    #header {
    border-bottom: 1px solid #777;
    padding: 1em;
    background: #ddd;
    }
    #left {
    float: left;
    width: 170px;
    padding: 1em;
    }
    #right {
    float: right;
    width: 170px;
    padding: 1em;
    }
    #content {
    margin-left: 200px;
    margin-right: 200px;
    border-left: 1px solid #777;
    border-right: 1px solid #777;
    padding: 15px;
    }
    #content p {
    margin-bottom: 20px; 
    }
    #content h2 {
    margin: 0 0 .5em 0;
    }
    #footer {
    clear: both;
    border-top: 1px solid #777;
    text-align: center;
    padding: 10px;
    background: #ddd;
    }
    </style>
    </head>
    
    <body>
    
    <div id="wrapper">
    
    	<div id="header"><h1>Header</h1></div>
    
    	<div id="left">
    	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
    	incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
    	nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    	Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
    	fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
    	culpa qui officia deserunt mollit anim id est laborum.</p>
    	</div>
    	
    	<div id="right">
    	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
    	incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
    	nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    	Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
    	fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
    	culpa qui officia deserunt mollit anim id est laborum.</p>
    	</div>
    	
    	<div id="content">
    	
    	<h2>Content header</h2>
    	
    	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
    	incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
    	nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    	Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
    	fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
    	culpa qui officia deserunt mollit anim id est laborum.</p>
    	
    	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
    	incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
    	nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    	Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
    	fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
    	culpa qui officia deserunt mollit anim id est laborum.</p>
    	
    	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
    	incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis 
    	nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    	Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 
    	fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
    	culpa qui officia deserunt mollit anim id est laborum.</p>
    
    	</div>
    	
    	<div id="footer"><p>Lorem ipsum dolor sit amet</p></div>
    
    </div>
    
    </body>
    </html>
    .
    .

  • #4
    New Coder
    Join Date
    Aug 2007
    Posts
    66
    Thanks
    2
    Thanked 0 Times in 0 Posts
    in your div's css it might fix it if you include position:relative; top:0; then it should line up.

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    It didn't work with that CSS. However I fiddled a little with Jutlanders code and found out, that the way to archieve would be to "cheat the look". So, I made my #container div the same color as the divs in the two sides, and now it works

  • #6
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Faking a height (for example) is an action I do quite often, when making layouts. It would be a lot easier if IE supported the min-height, min-width, max-height and max-width properties and didn't stretch something with a set height.

    Let's hope the IE team will pull themselves together and rewrite the Trident engine. Let's face it, if it can be written, it can also be rewritten and modified. On the W3C website they say that the IE team is very active to meetings and that they actually work hard on making it better (will find he link if I can find it) - well we can't really use that if we don't see some improvements can we?
    Last edited by Jutlander; 08-09-2007 at 07:35 PM.
    .
    .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •