我有一个容器,它水平滚动,里面有复选框.选中复选框后,将显示文本.我想保持项目的功能从两边都在增长.问题是,当一些复选框被选中时,第一个复选框是隐藏的,您无法滚动到它:
.container {
white-space: nowrap;
text-align: center;
display: flex;
overflow-x: scroll;
justify-content: space-around;
align-items: stretch;
}
.item {
transition: 0.5s ease;
height: 40px;
justify-content: center;
text-align: center;
}
label {
font-size: 0;
transition: 0.5s ease;
}
input:checked~label {
font-size: 20px;
}
<div class="container">
<div class="item">
<input type="checkbox" id="1"></input>
<label for="1">1111111111111111111111111</label>
</div>
<div class="item">
<input type="checkbox" id="1"></input>
<label for="2">22222222222222222222222222222222222</label>
</div>
<div class="item">
<input type="checkbox" id="1"></input>
<label for="3">333333333333333333333333333333</label>
</div>
</div>
有没有一种方法可以让过渡保持从中心开始,同时仍然让用户一直滚动到开始和结束?
谢谢!