how do I hide the default border of an image.
The image border
code:
<html>
<style>
#image{
width: 60px;
height: 60px;
}
</style>
<body>
<div><img id="image" alt="art" src="https://upload.wikimedia.org/wikipedia/commons/3/3f/JPEG_example_flower.jpg"></div>
</body>
</html>
I tried to add opacity:0, the border was hidden but the image that was supposed to appear there was also hidden. I only want to hide the border that appears when no image is found.
2
Answers
As said before, inside your style tags add:
When I looked at the img attached I saw a img not loaded,I’m assuming you want to remove the border? of the img when it can not be fetched.This is an example where the element is removed on a error.I will also add code to replace the img element.
The first element loades because it has a correct link the second however dose not.
The following would be an example of replacing a img with an error with a warning.You could replace this so that the not loaded icon apears without a border.
As you can see the img failing to load is replaced by the text 404 you can modify this to insert the "img not found icon".