0

The content property isn't working with a :hover selector on any version of IE

HTML:

<img class="helpButton" src="images/helpButton.png" alt="Help Button" />

CSS:

.helpButton:hover {content:url(../images/helpButton-hover.png); cursor: pointer}

Note that I do have an HTML 5 doctype (<!DOCTYPE html>).

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Ben
  • 213
  • 4
  • 13
  • Try putting the URL in quotes: `url("../images/helpButton-hover.png")` – SharkofMirkwood May 01 '14 at 23:09
  • That is how I had it originally and it wasn't working then either. – Ben May 01 '14 at 23:21
  • Is it working in other browsers? I just realised what you're doing doesn't make much sense. Instead of setting the content of the image to an image, maybe you should create a wrapper around the image and set the content of that. – SharkofMirkwood May 01 '14 at 23:23
  • 2
    As of CSS 2.1, The `content` property is undefined when used on replaced elements. You're best off not using it. – Adrift May 01 '14 at 23:31

0 Answers0