I am facing a problem with image height. I want to make that image 100% height without hard coding. But i can't do that. Every time some margin goes bottom to the image. I have changed the image width, height, font size but nothing works.
Here is an example of the image not filling the height:
* {
margin: 0;
padding: 0;
outline: none;
box-sizing: border-box;
}
html {
font-size:16px;
}
body {
font-family: Raleway, "Times New Roman", Times, serif;
background-color: #f6f6f6;
line-height: 1.5rem;
width: 100%;
color: #424242;
}
.flexbox {
display: flex;
justify-content: space-between;
}
.img-responsive {max-width:100%;max-height:100%;}
.card {
background-color: #ffffff;
border: 2px solid red;
margin: 1.5rem 0rem 0rem;
width: 75%;
}
.post-card-body {
padding: 1.5rem;
}
.post-card-heading {
margin: 0 0 0.75rem;
}
.btn-section {
margin-top: 1rem;
}
.continue-btn {
background-color: #ffb69b;
border-color: #ffb69b;
}
.btn {
font-size: 0.75rem;
text-transform: uppercase;
color: #ffffff;
padding: 0.75rem 1.25rem;
border: 0.0625rem solid #e9e9ea;
}
<div class="flexbox card">
<div class="post-card-img">
<img src="http://via.placeholder.com/300x300/DDaDaa/FFFFFF" alt="" class="img-responsive" />
</div>
<div class="post-card-body">
<div class="post-card-heading">
<h3>Lorem ipsum dolor sit amet.</h3>
<h6>By <a href="#">Admin Ahsan</a> September 11, 2015</h6>
<hr />
</div>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum
atque sed in, fugiat natus laboriosam
</p>
<div class="btn-section">
<button class="btn continue-btn">Continue Reading</button>
</div>
</div>
</div>
codepen link: click here Screenshot: click here