Board Thread:Support Requests - Getting Technical/@comment-12198205-20140530122129/@comment-856287-20140531182041

As I said, a pseudo-class like :hover can't be an inline style. It must be pre-defined in a CSS file, such as Special:CSS. So you can do:

If you only need to have it replace the image on hover with something from a pre-defined set, you can do that: Just specify each image as it's own class in the CSS file. So…

…and then your template simply defines which of those to use:

If you want it to be fully dynamic so the user can define any image for both…

…you would have to use javascript. You can't define a pseudo-class (like :hover) inline, so you can't define it in a template.