1

I have parent div with a class row-fluid, I want its child divs to be same height as the parent div.

<div class="row-fluid">    
    <div class="span2">            
    </div>      
    <div class="span7">              
    </div>       
    <div class="span3">                                       
    </div>
</div> 

Here is my css code:

.row-fluid{
    float: left;
    width: 100%;
    background: blue;
}


.row-fluid > .span2{
    float: left;
    width: 23.076923076923077%;
    background: red;
}

.row-fluid > .span7{
    float: left;
    width: 48.5%;
    background: yellow;
}


.row-fluid > .span3{
    float: left;
    background: green;
}

Here is the image that illustrates my divs:

enter image description here

The blue region is my parent div and the red, yellow and green region corresponds to its child divs.

Daniel Cheung
  • 4,779
  • 1
  • 30
  • 63

1 Answers1

1

Why not set a height on your parent div and height: 100% on your child spans?

.row-fluid {
  height: 300px;
}

.row-fluid > .span2,
.row-fluid > .span7,
.row-fluid > .span3 {
  height: 100%;
}

Otherwise, you might wanne have a look at this article.

user1438038
  • 5,821
  • 6
  • 60
  • 94