:not(:empty) CSS selector is not working?

后端 未结 11 1103
我寻月下人不归
我寻月下人不归 2020-11-28 06:22

I\'m having a heck of a time with this particular CSS selector which does not want to work when I add :not(:empty) to it. It seems to work fine with any combina

11条回答
  •  伪装坚强ぢ
    2020-11-28 06:36

    Another pure CSS solution

    .form{
      position:relative;
      display:inline-block;
    }
    .form input{
      margin-top:10px;
    }
    .form label{
        position:absolute;
        left:0;
        top:0;
        opacity:0;
        transition:all 1s ease;
    }
    input:not(:placeholder-shown) + label{
        top:-10px;
        opacity:1;
    }

提交回复
热议问题