How to remove borders around broken images in webkit?
Amit's answer is just great, but a small advice: use visibility: hidden; instead of display: none;
img:not([src]) {
visibility: hidden;
}
- so you could save img block size and positioning of other elements. its usefull in most cases, i use it on my sites with images lazyload and show just blank block before the image loads.
If img
src
is not present or broken then use below css
code
img:not([src]){ display:none; }
this css hide image till img
src
is not loaded completely.