I’m trying to fit jerry mouse image in the boundary image, but unable to do it
like this
this i want to achieve
what I have done here is –>
taken one parent div in which I have one image tag with boundary image, and trying to put mickey mouse image in the bacground of boundary image,
my index.html file
<body>
<div class="parent">
<img src= "images/circle-2.png" class = "boundary"/>
</div>
</body>
my app.css file
.boundary{
width : 300px;
height: 300px;
width: fit-content;
background-repeat: no-repeat;
background-image: url(./images/mickey.jpeg);
background-position: center;
background-size: 69%;
background-clip: content-box;
}
div {
display: flex;
justify-content: center;
}
Thanku in advance
2
Answers
You could achieve this using
background-size: contain;
.I’m not 100% sure exactly what the criterias are. The key CSS property/value responsible for the circle is:
border-radius: 50%
.