hover inside style tag code example

Example 1: hover style html

/* css file */
.callitwhatever:hover
{
    background: none;
}

/* HTMl File */
<li><a href="#" class="callitwhatever"> Logo</a></li>

Example 2: how to apply hover through inline css

document.getElementById("mydiv").onmouseover= function(e){this.className += ' my-special-class'; };
document.getElementById("mydiv").onmouseleave= function(e){this.className = this.className.replace('my-special-class',''); };

Example 3: how to apply hover through inline css

document.head.insertAdjacentHTML('beforeend', '<style>#mydiv:hover{color:red;}</style>');

Tags:

Css Example