HTML
<div class="cont">
<div class="size" id="size1"></div>
<div class="text">Here is some textHere is some text Here is some text</div>
</div>
<div class="cont">
<div class="size" id="size2"></div>
<div class="text">Here is some textHere is some text Here is some text</div>
</div>
CSS
.size {
background-color: red;
height: 100px;
width: 100px;
}
#size2 {
width: 200px;
}
.cont {
padding: 10px;
float: left;
}
I need div.cont
's widths to be the width of their contained div.size
(in my actual example div.size
is an image and its with will vary in each instance).
This isnt happening as div.text
takes up more space than its container, how can I stop this and make the text wrap?