본문 바로가기
CSS

input checkbox 스위치모양

by 영감은어디에 2024. 4. 25.

<label class="switch">
     <input type="checkbox" checked>
     <span>아이디 저장</span>
</label>
.switch { cursor:pointer; color: #E8E8E8;  display: inline-flex;align-items: center; font-size: 18px;} 
.switch input[type="checkbox"] { position: relative; border: 0; border-radius: 1.25em; width: 48px; height: 24px; background-color: #6b768b; } 
.switch input[type="checkbox"]::before { content: ""; position: absolute; left: 4px;top:4px; width: 16px; height: 16px; border-radius: 50%;  background-color: #fff; transition: all 0.3s; } 
.switch input[type="checkbox"]:checked { background-color: #0075FF;  } 
.switch input[type="checkbox"]:checked::before {  left: 27px ; }

 

'CSS' 카테고리의 다른 글

scroll 스크롤바 css  (0) 2024.04.25
tab 라디오버튼으로 만들기  (0) 2024.04.25
텝 css  (0) 2024.04.25
input checkbox 만들기  (0) 2024.04.25
Grid 레이아웃 한방 정리. 고정값 가변값  (0) 2024.04.25
pretendard 프리텐다드 웹폰트 적용하기  (0) 2023.06.11
ion icon  (0) 2023.04.28
유튜브 웹페이지 배경으로 넣기  (0) 2023.02.26