Is it possible to fake a empty image in html that behaves like a real one but doesn't exist?
For example i have a responsive column in which should be a 200x150px image (which gets styled: width: 100%; height: auto;
because its responsive) ... But if there is no image it should be placed a placeholder that fakes exactly the size that a real 200x150px sized image would have.
I tried a image tag like the following but it doesn't work because of that height: auto
. About that weird src look at this.
<img src="//:0" alt="" width="200" height="150" />
Would it be possible to generate a empty png with php?
<img src="fake.php?s=200x150" alt="" />
EDIT: Some guys mentioned the service placehold.it. Basically that is exactly what i need (And in most cases absolutely adequate) but because this is for a WordPress Plugin it should also run locally whithout internet connection. Best would be a solution without external services.