Languages

CSS - remove double / duplicated border from image element

9 points
Asked by:
Kenya-Spears
860

Any one knows, how to remove duplicated border from img element. It looks like the image element has set border 2 times (2px border width when I set only 1px).

Screenshot:

Code:

 

1 answer
6 points
Answered by:
Root-ssh
178430

Web browser displays 2px border, because your image src attribute is not set.

To fix it, you can set 1x1 px transparent image as default src value - change it to desired image URL when URL will be available.

1x1 px transparent GIF image as Base64 Data URL is:

So, the solution is:

References

  1. HTML - empty transparent one pixel gif image as Data URL (1x1 px image)
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join