Set a:hover based on class

前端 未结 6 1413
星月不相逢
星月不相逢 2020-12-24 04:28

I have the following HTML:


      
6条回答
  •  抹茶落季
    2020-12-24 05:22

    try this

    .div
    {
    text-decoration:none;
    font-size:16;
    display:block;
    padding:14px;
    }
    
    .div a:hover
    {
    background-color:#080808;
    color:white;
    }
    

    lets say we have a anchor tag used in our code and class"div" is called in the main program. the a:hover will do the thing, it will give a vampire black color to the background and white color to the text when the mouse is moved over it that's what hover means.

提交回复
热议问题