DIV Position

Discussion in 'HTML & Website Design' started by Erind, Dec 4, 2006.

  1. #1
    Well, I gave pure CSS a crack on my current site. I'm stuck though.

    I have a container div, and then 2 columns inside the container, one set to float left and the other float right. Somehow when the columns expand vertically, they don't push the container div's bottom border down, but rather just over ride it. How do I fix this?

    
    div#outer{
    	width:780px;
    	border:5px solid #633e17;
    }
    div#left{
    	float:left;
    	width:443px;
    	border:1px solid #80ae35;
    }
    div#right{
    	float:right;
    	width:336px;
    	border:1px solid #80ae35;
    }
    
    Code (markup):
     
    Erind, Dec 4, 2006 IP
  2. smallbuzz

    smallbuzz Peon

    Messages:
    125
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You have clear the floats within the container, so do something like this:

    <div id='outer'>
    <div id='left'>
    </div>

    <div id='right'>
    </div>

    <div style='clear:both'></div>
    </div>
     
    smallbuzz, Dec 5, 2006 IP