I meant to say I’ve always assumed that CSS based image dimensions (not the parent container) would have the same effect as specifing them in the IMG tag since the CSS is loaded in tandem with rendering the page HTML.
In WebKit and Gecko, image dimensions on the img tag are just aliases for the same thing in CSS styles, so whether it’s defined in CSS or in the image tag, it’s the same thing. I am not sure about IE or Opera tho.
In Chrome for instance, if you inspect an image with dimensions on the img tag, you’ll see something like this in the css property list, even if it’s not in your CSS file:
img[width=300]{
width:300px;
}
img[height=300]{
height:300px;
}
I’m not sure in which version of chrome this was added. I’m guessing that WebKit doesn’t even have any code that handles the dimensions on the tag separately from css, and instead uses css attribute selectors to handle the dimensions on the tag itself. In standards mode at least.
img:not([width]):not([height]), img:not([alt]) {
border: 2px solid red !important;
}
Border could break the layout, or the borders could be hidden. Outline doesn’t affect layout, and is always displayed on top of everything else.