I am working on creating a responsive div that includes an image, text, and spacing between the divs. Initially, I had divs with spacing and text but they did not resize properly when more text was added. I am aiming to achieve a layout similar to this: https://i.sstatic.net/JsRg9.png
One example I found has more text in some of the divs while every other div also resizes accordingly: https://i.sstatic.net/dhw3U.png
This is what my current setup looks like:
.img{
width:300px;
height:100%;
}
.image {
position: relative;
width: 100%; /* for IE 6 */
}
h3{
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 105px;
left: 0;
width: 300px;
color:white;
}
<div class="image">
<img src="http://i.imgur.com/VCsr2MH.png" alt="" class="img" />
<h3>A Movie in the Park:<br />Kung Fu Panda</h2>
</div>
<div class="image">
<img src="http://i.imgur.com/VCsr2MH.png" alt="" class="img" />
<h3>A Movie in the Park:<br />Kung Fu Panda</h2>
</div>
<div class="image">
<img src="http://i.imgur.com/VCsr2MH.png" alt="" class="img" />
<h3>sadasdsadsadsadsadsadasdasdsadsadsadsadas</h2>
</div>
The goal is for the div to resize based on the amount of text and cover the bottom part. Currently, I am using "< br >" tags to break the text, which is not the ideal solution I am aiming for.