Trying to have an inline image auto crop inside a div to simulate a background image. I tried using absolute position with a size larger than 100% but when you resize it works for the height one time and then breaks for the width another. I am assuming the square shape doesn't help any. Do you have any suggestions on how to resolve this result?
Is JavaScript the best way to make this work?
body {
background: #000;
}
.container {
background: #ccc;
}
.row {
border: 1px solid #fff;
}
.col-md-6 {
border: 1px solid red;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-md-6">
<img src="http://dummyimage.com/600x500/500/fff" class="img-responsive" />
</div>
<!-- /.col-md-6 -->
<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>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>