chrome/safari display border around image chrome/safari display border around image google-chrome google-chrome

chrome/safari display border around image


Now I don't know if this is a bug with Chrome or not but the grey border appears when it can't find the image, the image url is broken or as in your case the src isn't there. If you give the image a proper URL and the browser finds it then the border goes away. If the image is to not have a src then you will need to remove the height and width.


sarcastyx is right, but if you want a workarround you can set the width and height to 0 and a padding to make space for your image.

If you want a icon of 36x36, you can set width and height to 0 and pading:18px


I know it is an old question. But another solution is to set the src to a 1x1 transparent pixel

<img class="related_photo"     src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />

This works for me.