CSS

[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



분류 제목
counter CSS - counter-set 속성 - 카운터 초기값(=시작값)을 부모요소에 설정 (= counter-se…
css CSS - page-break-before 속성 -
border CSS - border-block-end-color 속성 - 블락방향 끝테두리 색상 지정 (= border-…
css CSS - caret-color 속성 - '입력/편집' 가능 요소의 커서 색상 변경 (= caret-colo…
css CSS - break-after 속성 - 지정요소 뒤에서 (페이지분할/컬럼분할/영역분할) 발생 여부 지정 (…
scroll CSS - scroll-margin-top 속성 -
scroll CSS - scroll-padding-inline-start 속성 -
resize CSS - scale 속성 - 요소 크기 변경 (= scale속성 = 스케일속성) ※ 요소 사이즈 ※ 요소 …
scroll CSS - scroll-margin-inline-start 속성 -
grid CSS - grid 속성(C) - 그리드 레이아웃 단축속성 (= grid속성 = 그리드속성)
font CSS - font-variant-caps 속성 -
border CSS - border-block-end-style 속성 - 블락방향 끝테두리 모양 지정 (= border-…
grid CSS - grid-column-end 속성(I) - 그리드 아이템 열 끝 위치나 확장 지정 (= grid-…
grid CSS - grid-row-end 속성(I) - 그리드 아이템 행 끝 위치나 확장 지정 (= grid-row…
position CSS - overflow-y 속성 - 수직방향으로 넘치는 내용 처리 방법 지정 (= overflow-y속성…
10/35
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인