search

Home  >  Q&A  >  body text

How to activate link and div element at the same time?

When I hover over the div element, only it lights up, the link does not. Is there a way to make the button brighter as a whole, instead of brightening the button background first and then the link.
Buy
Buy
Buy
a: visited { white color } a:hover:visited{ Color: RGB(180, 179, 179); } a link { white color; Background color: rgb(180, 179, 179); } a:hover { Color: RGB(180, 179, 179); Background color: white } div.b{ white color; Background color: rgb(180, 179, 179); } div.b:hover{ Color: RGB(180, 179, 179); Background color: white } a:link { text decoration: none; } a:visited { text decoration: none; } a:hover { text decoration: none; } a:active { text decoration: none; } I tried everything I know
P粉547170972P粉547170972467 days ago930

reply all(1)I'll reply

  • P粉262926195

    P粉2629261952023-09-17 13:37:28

    Try it

    .b:hover {
      background: #ccc;
    }
    
    .b:hover a {
      background: green;
    }
    
    /* 或者 */
    .b a:hover {
      color: red;
    }

    https://codepen.io/roma3z/pen/QWxapdB

    reply
    0
  • Cancelreply