So here is a picture:
What the problem is that I have 2 divs in a cont
This is what you're looking for...
http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks
Also, I'm assuming you're using float
, so I highly recommend you give this a read:
http://coding.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/
... remember to clear your floats!
The problem you're talking about is called "faux columns" and have been reported and described well over past few year :) http://www.alistapart.com/articles/fauxcolumns/
There are several solutions:
The last solution is quite good so if you're using jQuery then it could be achieved like that:
var max=0;
$('#container').children().each(function(){
if($(this).height()>max) max = $(this).height();
});
$('#container').children().each(function(){
$(this).height(max);
});
The script iterates through all children of the container and finds the highest element. Then it iterates again and sets the maximum height to each of them.
HTML
<div class="wrapper">
<div class="child_1">First Div content goes here</div>
<div class="child_2">Second Div content goes here</div>
</div>
CSS
.wrapper {
width: 960px;
overflow: hidden;
margin: 0px auto;
}
.child_1, .child_2 {
padding-bottom: 9999em;
margin-bottom: -9999em;
width: 50%;
float: left;
}
.child_1 {
background: #f00;
}
.child_2 {
background: #0f0;
}
Try adding a border-right to the left div. Add a div inside the container div with a clear class. Then in css add this: .clear{clear:both;}