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

Change image default white background

I have a div with a anchor tag. Inside the anchor tag I want to have an image. Basically, the image come with a white background. I’m trying to change this background to div’s color (grey). The photo is a square and the part left from image has a white background. Is there any possibility to change this??

<div class="container">
            <a target="_blank" href="">
                <input class="image" type="image" alt="" src="photo.png">
            </a>
</div>

>Solution :

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

If the white background is part of the image, it means the image file contains white pixels as background, you won’t be able to change it with code (in a simple way).
I suggest you edit the picture using https://www.photopea.com/ or any other image editing software (Photoshop, Gimp, …) to delete those white pixels, then save the picture as PNG to keep its transparency aspect.

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