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

后端 未结 11 1076
我寻月下人不归
我寻月下人不归 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:25

    .floating-label-input {
      position: relative;
      height:60px;
    }
    .floating-label-input input {
      width: 100%;
      height: 100%;
      position: relative;
      background: transparent;
      border: 0 none;
      outline: none;
      vertical-align: middle;
      font-size: 20px;
      font-weight: bold;
      padding-top: 10px;
    }
    .floating-label-input label {
      position: absolute;
      top: calc(50% - 5px);
      font-size: 22px;
      left: 0;
      color: #000;
      transition: all 0.3s;
    }
    .floating-label-input input:focus ~ label, .floating-label-input input:focus ~ label, .floating-label-input input:valid ~ label {
      top: 0;
      font-size: 15px;
      color: #33bb55;
    }
    .floating-label-input .line {
      position: absolute;
      height: 1px;
      width: 100%;
      bottom: 0;
      background: #000;
      left: 0;
    }
    .floating-label-input .line:after {
      content: "";
      display: block;
      width: 0;
      background: #33bb55;
      height: 1px;
      transition: all 0.5s;
    }
    .floating-label-input input:focus ~ .line:after, .floating-label-input input:focus ~ .line:after, .floating-label-input input:valid ~ .line:after {
      width: 100%;
    }

提交回复
热议问题