CSS :focus not working

后端 未结 4 573
情话喂你
情话喂你 2020-12-10 06:12

I tried using :focus CSS pseudo-class in my project. I want to change the color of the element where I click on it. Now when I click my element cha

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 06:39

    .row {
      display:inline-block;
      border:1px solid grey;  
      height:200px;
      width: 200px;
      line-height:1em;
      background: grey;
      margin: 5px;
      opacity: 0.1;
    }
    
    .row:active, .row:focus { background: orange; opacity:1 }

    Please try this...

提交回复
热议问题