I am clamping image sizes with CSS:
#somewhere img {
width: 160px;
height: 90px;
}
When all images load properly, my page layout looks good. On the other hand, if any particular image does not load, my page layout gets screwed up because the broken image will occupy 0px by 0px. Elements around that broken image will scrunch upwards. How do I make broken images still respect the CSS dimensions so my layout doesn’t collapse?

Adding
display: blocktoimgshould be good enough:If that somehow doesn’t work, then wrapping the
imgin another element will work.I chose
spanbecause that’s the usual choice for frivolous wrappers.