I'm struggling to align images to the left of text within a div.
When the screen is smaller than 768px, I want the images to stack on the left side of the text, with a maximum width of 150px. I've tried using float: left and adjusting the display property but it's not working as expected.
You can see the issue at this CodePen link
#mu-featured {
position: relative;
width: 100%;
margin-top: 50px;
}
#mu-featured h2 {
font-family: lato;
font-size: 16px;
font-weight: bold;
}
#mu-featured p {
font-family: Roboto;
font-size: 15px;
color: #999;
}
.mu-featured-img img {
width: 100%;
height: auto;
border-radius: 3px;
margin-bottom: 25px;
}
.mu-featured-area {
padding: 70px 0 50px;
width: 100%;
}
@media (max-width: 767px) {
.mu-featured-container {
overflow: auto;
}
.mu-featured-img {
float: left;
}
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<section id="mu-featured">
<div class="container">
<div class="row">
<div class="col-xl-4 col-md-4 col-sm-12 mu-featured-container">
<div class="mu-featured-img">
<img src="https://static.pexels.com/photos/92623/pexels-photo-92623.jpeg" alt="">
</div>
<div class="mu-featured-content">
<h2>TITLE</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
</div>
</div>
<div class="col-xl-4 col-md-4 col-sm-12 mu-featured-container">
<div class="mu-featured-img">
<img src="https://static.pexels.com/photos/92623/pexels-photo-92623.jpeg" alt="">
</div>
<div class="mu-featured-content">
<h2>TITLE</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
<a href="#" class="">Call to action!</a>
</div>
</div>
<div class="col-xl-4 col-md-4 col-sm-12 mu-featured-container">
<div class="mu-featured-img">
<img src="https://static.pexels.com/photos/92623/pexels-photo-92623.jpeg" alt="">
</div>
<div class="mu-featured-content">
<h2>TITLE</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</p>
<a href="#" class="">Call to action!</a>
</div>
</div>
</div>
</div>
</section>