I have this simple markup for a div:
<div class="gallery__card">
<img class="gallery__card__img" src="1.jpg">
<div class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
</div>
But I want gallery__card
to be as wide as gallery__card__img
, so the text
below the image doesn't take the full page width.
I want to avoid setting fixed widths, since this is supposed to be responsive.
Is there a way to accomplish this without JS nor fixed widths?
jsfiddle: http://jsfiddle.net/6h19oa1q/