I'm experiencing an issue where my cover is wider than my element and content. It seems to be covering the gunter, but I've tried using background-clip: content-box;
and box-sizing: border-box;
, which haven't resolved the problem. I also want to maintain the rounded corners. How can I fix this?
.myElem {
position: relative;
width: 200px !important;
height: 200px;
margin-bottom: 1rem;
}
.content {
width: 100%;
height: 100%;
background-color: yellow;
}
.cover {
position: absolute;
bottom: 0;
width: 100%;
background-color: red;
height: max-content;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.cover:hover {
height: 95%;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="46242929323532342736067368766874">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row myDiv">
<div class="myElem">
<div class="content">
<p>Lorem ipsum...</p>
</div>
<div class="cover">
<p>Lorem ipsum...</p>
</div>
</div>
<div class="myElem">
<div class="content">
<p>Lorem ipsum...</p>
</div>
<div class="cover">
<p>Lorem ipsum...</p>
</div>
</div>
</div>