CSS - Change img tag's source image

To change source attribute of an img tag, use this CSS:

<img id="myimg">

CSS:

img#myimg {
    content:url("/path/to/myimage.jpeg");
}

img#myimg:hover {
    content:url("/path/to/otherimage.jpeg");
}

Comments