I need image with rounded bottom corners inside rounded div.
I tried to set image border radius, but div exceeds image. Where do I make a mistake?
Is there a way how to fix it? Or do we have better solution? Thank you for all answers
Here is my code
.mainTile{
position: absolute;
background-color: red;
border-radius: 15px;
}
.mainTileHeader
{
width: 90%;
margin-left: auto;
margin-right: auto;
}
.mainTileHeader h2
{
text-align: center;
margin-top: 10px;
color: white;
margin-bottom: 10px;
}
.mainTileImg
{
width: 100%;
-webkit-border-radius: 0 0 15px 15px;
}
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
border-radius: 20px;
position: absolute;
right: 10px;
bottom: 10px;
}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="widht=device-width">
<title>Main</title>
</head>
<body>
<div class="mainTile" style="width: 300px;">
<div class="mainTileHeader">
<h2>Header</h2>
</div>
<img src="https://picsum.photos/300/?random" alt="item" class="mainTileImg">
<button class="button">xxxxx</button>
</div>
</body>
</html>