I need to crop a div to fit the size of an image, and be placed on top of it.
Basically I’m trying to draw a black box on an image I have on a webpage.
Code:
<div class="col-9" style="display: flex; justify-content: center;">
<div class="itemscenter" style="border-style: solid; border-width: 4px;">
<img style="width: 85%" src="../Images/fov110.png">
</div>
</div>
I made a border then tried cutting the div.
I also used a width percent thing.
2
Answers
Just make the outside div smaller and set the image’s width to 100%
you need to set height of image according to your reqirement.