On input focus change color of label. How?

前端 未结 5 1753
终归单人心
终归单人心 2020-12-20 14:19

On input focus I want to change the color of the label element. How can I achieve this in less?

.control-label{
      color: @gray-light;
}
.co         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 14:55

    The easy way is to use :focus-within check developer mozilla

    .control-group:focus-within .control-label {
       color: red;
    }
    

    Or

    .control-group:focus-within label {
       color: red;
    }
    

提交回复
热议问题