Change link color on div hover

前端 未结 3 1042
醉酒成梦
醉酒成梦 2021-01-12 05:40

How do I change my link colors when I hover a div?

I tried to use:

#voltarTEST {
    width: 80px;
    height: 62px;
    padding-top: 16px;
    backgr         


        
相关标签:
3条回答
  • 2021-01-12 06:08

    Add this:

    #voltarTEST:hover a{
        text-decoration: none;
        font-size: x-small;
        font-family: Verdana;
        text-decoration: none;
        color:#FFF;
    }
    
    0 讨论(0)
  • 2021-01-12 06:20

    Use the :hover on the div instead of the a :

    #voltarTEST:hover a{
        text-decoration: none;
        font-size: x-small;
        font-family: Verdana;
    
        text-decoration: none;
        color:#FFF;
    }
    
    0 讨论(0)
  • 2021-01-12 06:25

    You want to set the hover event on the div, not the link..

    #voltarTEST a:hover should be #voltarTEST:hover a

    The first (the way you had it) says when the link inside of the voltarTEST div is hovered on. The second says apply this style to links inside voltarTEST when voltarTEST is hovered on.

    Here's a DEMO

    0 讨论(0)
提交回复
热议问题