div background color, to change onhover

后端 未结 10 1283
轮回少年
轮回少年 2020-11-27 04:54

I\'m trying to make a div\'s background color change on mouse over.

the div {background:white;}
the div a:hover{background:grey

10条回答
  •  攒了一身酷
    2020-11-27 05:33

    html code:

        
        
        this is your web page
        
        

    css code:

        .nicecolor {
          color:red;
          width:200px;
          height:200px;
         }
    
        .nicecolor:hover {
          color:blue;
         }
    

    and thats how youll change your div from red to blue by hovering over it.

提交回复
热议问题