I have something like the following
<div class='texts-container'>
<div class='texts-title'>Text title</div>
<div class='texts'><p>some texts here. Dynamically generate.</p></div>
</div>
CSS
.texts-container{
width: 650px;
height: 120px;
margin: 18px;
}
.texts-title{
float: left;
padding: 10px;
background-color: #ECECEC;
height: 80px;
width: 130px;
line-height: 80px;
text-align: center;
vertical-align: middle;
}
.texts{
background-color: #E2E2E2;
float: left;
padding: 5px;
height: 90px;
width: 430px;
}
current:
--------------------------
| siojfisojfosjfiosjfsif |
|jfisofjiosfjjsfjifosfjoisjf |
--------------------------
kfosdfkpsdkfsfp fkopsf
kopfkpsf fkopsfpsdk
Desired result
---------------------------
| siojfisojfosjfiosjfsif |
|jfisofjiosfjjsfjifosfjoisjf |
| kfosdfkpsdkfsfp fko |
| kopfkpsf fkopsfpsdk |
---------------------------
My question is how to make my .texts
div height automatically adjust if I have lots of texts in that div.
I don't want to set the height of the text
div very high as most of my contents are short. However, I do want to adjust the height automatically when I have large amount of contents. Can anyone give me a hint? Thanks!