Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the border around an image without a source?

Tags:

html

css

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?

like image 851
Tgwizman Avatar asked May 04 '12 01:05

Tgwizman


People also ask

How do you remove the outline of an image in HTML?

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.

How do I remove the border from an image in paint?

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.


1 Answers

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; } 
like image 181
Ricardo Rodrigues Avatar answered Oct 11 '22 08:10

Ricardo Rodrigues