• 회원가입
  • 로그인
  • 구글아이디로 로그인

[css] CSS - 구글 로그인 포커스 애니 효과 (Google Logn Foucs Animation Effect) ※ 다중 가상선택자 예제

 

 

<style>

body{

  font-family: sans-serif;

}


.input_group{

  position: relative;

  padding-top: 13px;

}


.input_group input{

  border: 1px solid lightgrey;

  border-radius: 5px;

  outline: none;

  min-width: 250px;

  padding: 15px 20px;

  font-size: 16px;

  transition: all .1s linear;

  -webkit-transition: all .1s linear;

  -moz-transition: all .1s linear;

  -webkit-appearance:none;

}


.input_group input:focus{

  border: 2px solid #3951b2;

}


.input_group input::placeholder{

  color:transparent;

}


.input_group label{

  pointer-events: none;

  position: absolute;

  top: calc(50% - 8px);

  left: 15px;

  transition: all .1s linear;

  -webkit-transition: all .1s linear;

  -moz-transition: all .1s linear;

  background-color: white;

  padding: 5px;

  box-sizing: border-box;

}


.input_group input:required:invalid + label{

  color: red;

}

.input_group input:focus:required:invalid{

  border: 2px solid red;

}

.input_group input:required:invalid + label:before{

  content: '*';

}

.input_group input:focus + label,

.input_group input:not(:placeholder-shown) + label{

  font-size: 13px;

  top: 0;

  color: #3951b2;

}

</style>


<div class="input_group">

  <input type="text" placeholder=" "/>

  <label>아이디</label>

</div>

<br/>

<div class="input_group">

  <input type="password" placeholder=" " required/>

  <label>비밀번호</label>

</div>

 

결과보기

tofanelli 님 https://codepen.io/tofanelli/pen/Ormgrz



분류 제목
image CSS - image-rendering 속성 - 크기 조정 가능 이미지의 렌더링 방식 지정 (= image-…
css CSS - inset 속성 -
css CSS - inset-block 속성 -
css CSS - inset-block-end 속성 -
css CSS - inset-block-start 속성 -
css CSS - inset-inline 속성 -
css CSS - inset-inline-end 속성 -
css CSS - inset-inline-start 속성 -
css CSS - isolation 속성 - 요소가 새 스택(stack: 쌓음) 콘텐츠를 생성해야 하는지 여부 지정…
grid CSS - justify-items 속성(C) - 인라인축 부분단위별 그리드 아이템 일괄 정렬 (= just…
grid CSS - justify-self 속성 -
box CSS - margin-block 속성 -
box CSS - margin-block-end 속성 -
box CSS - margin-block-start 속성 -
box CSS - margin-inline 속성 - 인라인방향 양쪽 끝 바깥 여백 주기 (= margin-inlin…
box CSS - margin-inline-end 속성 -
box CSS - margin-inline-start 속성 -
css CSS - mask-image 속성 -
css CSS - mask-mode 속성 -
css CSS - mask-origin 속성 -
21/25
목록
찾아주셔서 감사합니다. Since 2012