I have an image, and I haven't defined the source yet. It has a border :/
eg: <img src="" />
If I give it a source, the border goes away (due to the css: border:none
).
How can I remove the border around an image when it doesn't have a source?
Adding border="0" to your img tag prevents that picture from having a border around the image. However, adding border="0" to every image would not only be time consuming but also increase the file size and download time. To prevent all images from having a border, create a CSS rule or file with the following code.
Right-click on the picture or other object and choose Format <object type>. On the Colors and Lines tab, click Color and select No Outline.
What I could suggest is in case not having a src="" remove it and you can
img { display: none; } img[src] { display: block; }
or if you know like the url contains some special word, like http you can do:
img[src*="http"] { display: block; }
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