Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to crop a div

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just make the outside div smaller and set the image’s width to 100%

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading