I just had a game with CodePen code.
This may help / be what you want:
HTML:
<div class="container"> <div class="row"> <div class="col-md-6 background-cover-image"> <img src="http://dummyimage.com/600x500/500/fff" class="img-responsive" style="opacity: 0;" /> </div> <div class="col-md-6"> <h2>Heading</h2> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis officia animi consectetur obcaecati cum harum aliquam qui nisi aliquid sint. Nobis voluptas sequi voluptatem soluta ex sed nisi, sapiente dicta!</p> </div> <i class="clearfix" aria-hidden="true"></i> </div> </div>
CSS:
body {background:#000;} .container {background:#ccc;} .row {border:1px solid #fff;} .col-md-6 {border:1px solid red;}
The secret here is that the original image still exists (its opacity set to 0 ), so it is still โthereโ and gives the div some height. Please do not use inline styles like mine; move them to the CSS class - I just did it for an example!
It works fine for me - however, you will need to decide when the div in the background image (or whatever you would like to call it) positions itself over other content.
Pay attention to the use of the clearfix class in the <i> tag so that the content below it does not pop up and is not included in this batch. You can also use clearfix in another div - a very useful class! :)
Any questions, just ask.
Hope this helps! :)
source share