누군가 내가 애니메이션을 도울 수 있는지 궁금합니다. 숨겨진 체크 상자로 인해 div가 축소되었습니다. 확인란을 움직일 수는 있지만 div 자체는 움직이지 않습니다. 여러 클래스에서 전환을 설정하려고 시도했지만 행운은 없습니다. CSS에서 강력하지는 않습니다. 어떤 아이디어? 미리 감사드립니다!확인란으로 트리거되는 접을 수있는 애니메이션
CSS :
body {
font-family: "Open Sans", "Sans-serif", Arial;
letter-spacing: 0.03em;
padding: 5px;
color: #435757;
}
div.main {
width: 1000px;
margin-left: auto;
margin-right: auto;
}
div.content {
border-left: 3px solid;
border-color: #0066cc;
padding-left: 15px;
width: 95%;
margin-left: auto;
margin-right: auto;
}
div.labeltab {
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.2);
margin-top: 15px;
margin-bottom: 15px;
}
.toggle-box {
display: none;
}
.toggle-box + label {
padding: 10px;
cursor: pointer;
display: block;
clear: both;
font-size: 21px;
margin-right: auto;
margin-bottom: 5px;
text-align: left;
}
.toggle-box + label:hover {
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.toggle-box + label + div {
display: none;
margin-left: 0px;
margin-right: auto;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.toggle-box:checked + label {
color: #0066cc;
font-style: italic;
}
.toggle-box:checked + label + div {
display: block;
margin-right: auto;
}
.toggle-box + label:before {
content: "";
display: block;
float: left;
font-size: 21px;
font-weight: 300;
border-right: 3px solid;
border-bottom: 3px solid;
width: 7px;
height: 7px;
transform: rotate(-45deg);
margin-top: 6px;
margin-right: 20px;
margin-left: auto;
text-align: left;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.toggle-box:checked + label:before {
content: "";
color: #0066cc;
border-right: 3px solid;
border-bottom: 3px solid;
width: 7px;
height: 7px;
transform: rotate(45deg);
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
HTML :
<div class="LabelTab"><input class="toggle-box" id="identifier-8" name="grouped" type="checkbox"><label for="identifier-8"> Test 1</label>
<div>
<div class="content">
<h4>Content 1</h4>
<p>Stuff</p>
</div>
</div>
</div>
<div class="LabelTab"><input class="toggle-box" id="identifier-6" name="grouped" type="checkbox"><label for="identifier-6">Test 2</label>
<div>
<div class="content">
<h4>Content 2</h4>
<p>Stuff</p>
</div>
</div>
</div>
아코디언 CSS도 포함 할 수있다 : 초점을. 예 : focus & : 나란히 체크 됨 https://codepen.io/gcyrillus/pen/dsvwF –