Reputation: 27058
i have this situation
<div class="sub_project">
<div class="sbone brown_gradient optzeci">Description</div>
<div class="sbtwo optzecitwo">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</div>
</div>
.sub_project{
font-size: 16px;
margin: 10px 0;
background: #D7D7D7;
}
.brown_gradient{
background: #EB994F;
}
.sbone{
padding: 5px;
color: white;
float: left;
width: 160px;
margin: 0 10px 0 0;
}
.sbtwo{padding: 5px;}
.optzeci{height: 80px;}
.optzecitwo{min-height: 80px;} * html .optzeci { height:80px; }
I would like the <div class="sbone brown_gradient optzeci">Description</div>
height to grow with the amount of text.
Right now i set a min-height: 80px;
but i do't want to set height at all.
Also i don't want to use images or javascript
See jsfiddle
any ideas?
Thanks
Upvotes: 0
Views: 153
Reputation: 91657
Relatively position the container, .sub_project
, and give it left padding. Absolutely position .optzeci
and give it top: 0; left: 0; bottom: 0;
.
.sub_project {
...
padding-left: 175px;
position: relative;
}
.optzeci {
position: absolute;
top: 0;
left: 0;
bottom: 0;
}
Upvotes: 2
Reputation: 1602
if you can use jquery then you can assign height to the box on the fly. you just need to get the height on the div containing your text then assign the same height to description box.
here is my try: http://jsfiddle.net/W7Nrn/6/
Upvotes: 0