<object data="foobar.png" width=200 height=200> <img src="test.png" alt="Just testing."> </object>
Here foobar.png
is the main image, test.png
is the inverse image. According to the semantics of the object
element, the content of the element (here the img
element) should be displayed if and only if the primary data (specified by the data
attribute) cannot be used.
Despite the fact that browsers had terrible errors in object
implementations last year, this simple method works in modern versions of IE, Firefox, and Chrome.
source share