Can anybody advise me on this? WebKit browsers keeps on putting a gray 1px border around disabled images. The reason I need this removed is for email optimization for when email clients have images disabled. Works fine in Firefox, but WebKit browsers keep showing the border.
I have tried border:none !important
everywhere including inline, but Chrome/Safari are being stubborn.
Edit: Here is sample html with inline css
<img style="outline:none;text-decoration:none;display:block;border:none;-webkit-border:0;" border="0" src="images/rm_bnk.gif" width="10" height="10" alt="test" />
Adding border="0" to your img tag prevents that picture from having a border around the image.
Remove a border from a picture Select the picture whose border you want to remove. On the Page Layout tab, in the Page Background group, select Page Borders. Click the Borders tab. Under Setting, select None.
On the Design tab, choose Page Borders. In the Borders and Shading dialog box, in the Apply to list, choose the page (or pages) you want to remove the border from. Under Setting, choose None. Select OK.
Amit's answer is just great, but a small advice: use visibility: hidden; instead of display: none;
img:not([src]) {
visibility: hidden;
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With