Johan Johan - 1 year ago 69
HTML Question

How to use CSS hover inside html-tag?

I want to do something like this:

<li style="hover:background-color:#006db9;">

But it wont work. Is this possible to do in some way, or do I have to write the css in the head or external css-document?

Answer Source

This is not possible using the style attribute. You'll have to use CSS, either in the document itself or in an external file.

li:hover { background-color:#006db9; }

If that's not an option then you'll have to resort to JavaScript.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download