아래의 토글 오른쪽에 레이블을 추가하는 방법을 알고 싶습니다.토글 버튼 오른쪽에 레이블 추가
올바르게 정렬되지 않은 레이블을 추가하려고했습니다.
도움이 필요하십니까?
Plunkr 링크 - https://plnkr.co/edit/NdnF2OycDZpk2FiiB7D6?p=preview
index.html을
<!DOCTYPE html>
<html>
<head>
<style>
.switch {
position: relative;
display: inline-block;
width: 47px;
height: 20px;
}
.switch input {display:none;}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>
</head>
<body>
<label class="switch">
<input type="checkbox" checked>
<div class="slider round"></div>
</label>
</body>
</html>
내가 대답을하지만 디스플레이 사용 : 당신이 충분히 될 것 오래된 브라우저에 대한 답변이 필요하거나 않습니다 플렉스? – d3orn
희망이 도움이 될 것입니다. https://fiddle.jshell.net/h1vuuz2t/ –
링크를 확인하십시오.이 클래스에 CSS를 추가하십시오 : .switch {float : left;} –