How to make it so that when you hover the cursor over a block, it changes the beckground. The block is simple - div. Thank.

    1 answer 1

    CSS (not sure about IE)

    div {background:#fff;} div:hover {background:#000;} 

    Js

     <div onmouseover="this.style.background='#000';" onmouseout="this.style.background='#fff';"> 
    • thanks, everything works - Oleksiy Graban
    • or maybe you know how to do that when you hover over a link, a small field is formed around the link (like a button or something).
    • Similarly. Read in CSS about hover <code> a {background: #fff;} a: hover {background: # 000;} </ code> - korwru