사용한 부트스트랩 토글은 아래 사이트의 토글 버튼이다.
https://www.bootstraptoggle.com/
Bootstrap Toggle
offstyle string "default" Style of the off toggle.Possible values are:default,primary,success,info,warning,danger Refer to Bootstrap Button Options documentation for more information.
www.bootstraptoggle.com
구현하고 싶은 버튼
구현된 버튼
사이즈는 별도로 조정한것이고 옆에 흰색 부분이 구현이 안되어서 찾아본 결과 CSS를 추가하여 해결했다.
참고한 코드
.toggle > .toggle-group {
background:white;
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
color:#666;
}
.toggle.off {
border-color: rgba(0, 0, 0, .25);
}
.toggle-handle {
background-color: white;
border: thin rgba(0, 0, 0, .25) solid;
}
실제로 사용한 코드
.toggle-off {
border-color: rgba(0, 0, 0, .25);
}
.toggle-handle {
background-color: white;
border: thin rgba(0, 0, 0, .25) solid;
}
.toggle > .toggle-group CSS 부분은 크기를 조정해서 그런지 버튼 아랫부분에 흰줄이 생겨서 삭제했는데 구현하는 데에는 무방했다.
완성한 버튼 화면
참고 자료
https://github.com/minhur/bootstrap-toggle/issues/186
Bootstrap 4 fix without altering original js/css · Issue #186 · minhur/bootstrap-toggle
If you want to update the official version of bootstrap-toggle to work with Bootstrap 4, without altering the source js / css or forking the project, you can add the following CSS tweaks to your ow...
github.com
'HTML/CSS' 카테고리의 다른 글
[HTML/CSS] 입력 양식 관련 태그 input (0) | 2023.03.27 |
---|---|
[CSS] 스크롤바 만들기 (0) | 2023.03.22 |
[HTML] history 함수를 이용하여 비동기 페이지 이동 (0) | 2023.01.16 |
[HTML/CSS] 하이퍼링크 관련 태그 (0) | 2022.04.28 |
[HTML/CSS] 영역 관련 태그 (0) | 2022.04.28 |