728x90
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control-placeholder {
  position: absolute;
  top: 0;
  padding: 7px 0 0 13px;
  transition: all 200ms;
  opacity: 0.5;
  color: red;
}


.form-control:focus + .form-control-placeholder,
.form-control:valid + .form-control-placeholder {
  font-size: 75%;
  transform: translate3d(0, -100%, 0);
  opacity: 1;
}

매우 잘 된다.

 

출처: stackoverflow.com/a/58736840

 

How to create an animated form placeholder using pure CSS

I am using Bootstrap-Vue to build a form, and I would like the placeholder text to animate so that it sits on top of the input using CSS Transitions. I currently have this bit of code which is gen...

stackoverflow.com

 

  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기