If I define the following CSS rule:
img { max-width: 200px; max-height: 200px; border: 1px solid black; }
Is there a pure CSS way to detect image objects that are larger without size restrictions? Something semantically matches:
img:resized { border-color: green; }
Alternatively: is there a way to detect large images in the first place? For instance:
img { border: 1px solid black; } img[width>200px], img[height>200px] { max-width: 200px; max-height: 200px; border-color: green; }
Thanks!
source share