I am creating a card overlay, image is runing out of the div from the bottom.
I want it to stay in div.
Here is the code :
.card {
width:50%;
margin:0 auto;
}
.position-relative {
position: relative !important;
}
.image-hover {
overflow: hidden !important;
position: absolute;
}
.image-hover img,
.image-hover {
transition: transform 1.5s;
border-radius: 0.2rem;
}
.image-hover:hover img {
transform: scale(1.5);
border-radius: 0.2rem;
}
.image-hover:hover {
background: blue;
}
.overflow-hidden {
overflow: hidden !important;
}
.card__overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding-left: 10px;
padding-bottom: 10px;
color: #fff;
}
.overlay__text {
font-weight: 700px;
}
<div class="card">
<div class="position-relative image-hover">
<img src="https://cdn.pixabay.com/photo/2018/03/13/22/53/puzzle-3223941__480.jpg" class="overflow-hidden" alt="wererw" width="100%" height="300" />
<div class="card__overlay">
<div class="overlay__text">
<h3>Simple Image Overlay Hover Effects</h3>
<p>Plan your next adventure</p>
<a href="#" class="More">Read More</a>
</div>
</div>
</div>
<div>Some more text</div>
</div>