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

[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


방문 감사합니다. (즐겨찾기 등록: Ctrl + D)

분류 제목
text CSS - writing-mode 속성 - 텍스트 방향 가로/세로 제어. (= 글쓰기 방향 = 쓰기 모드 제…
css CSS - pointer-events 속성 - 마우스이벤트에 대한 반응 여부 (= pointer-events…
css CSS - hanging-punctuation 속성 - 문장부호 위치 지정 (= hanging-punctua…
css CSS - 자식요소 앞에 순번 붙이기 (= 색인번호 추가 = 요소 카운팅)
selector CSS - :indeterminate 선택자 - 불확정요소 선택 (= :indeterminate선택자 = 인…
css CSS - 구글 로그인 포커스 애니 효과 (Google Logn Foucs Animation Effect) …
selector CSS - :placeholder-shown 선택자 - 플레이스홀더 텍스트 표시 중인 요소 선택 (= :pl…
css CSS - 이미지 세로 나열 (= 수직 정렬) 방법/경우/원인/이유
selector CSS - ::-webkit-scrollbar - 스크롤바 선택자 (= 스크롤바 모양 디자인 커스텀 = Cu…
box CSS - block-size 속성 - 블락 방향으로 요소 크기 지정 (= block-size속성 = 블락…
box CSS - inline-size 속성 - 인라인방향으로 요소 크기 지정 (= inline-size속성 = 인…
text CSS - overflow-wrap 속성 - 줄바꿈 위해 단어 쪼개기 (= overflow-wrap속성 / …
background CSS - Multi Background 구문 - 한번에 여러 배경 속성값 사용
selector CSS - ::placeholder 선택자 - 플레이스홀더 선택자
css CSS - 인스타그램(instagram) 배경색 효과
css CSS - currentcolor 키워드 - 현재 글자색 속성값을 그대로 사용 (= 커런트컬러 속성값)
image CSS - object-fit 속성 - 컨테이너에 맞게 '이미지/비디오' 크기 조정 방법 지정 (= obje…
image CSS - object-position 속성 - <img>/<video>가 "자체 콘텐츠 상자" 내부의 x/…
css CSS - 코드펜 스타트 코딩 버튼 테두리 효과 (Codepen Start Coding Button Bord…
css CSS - translate 속성 - 2D/3D 상 요소 위치 좌표 변경 지정 (= translate속성 =…
16/25
목록
찾아주셔서 감사합니다. Since 2012