console
<input id="check" type="checkbox">
<p>个人觉得,display:table-cell最强的应用是可以任意个数列表的等宽效果。</p>
<div class="element">
<p>display:table-cell其他一些应用,例如,两栏自适应布局,垂直居中效果等等都是可以通过其他技术手段模拟出来的,但是,根据列表个数自动等宽的效果,其他CSS是很难模拟的,尤其当需要兼容IE8浏览器的时候。</p>
</div>
<label for="check" class="check-in">更多↓</label>
<label for="check" class="check-out">收起↑</label>
p{
width: 200px;
}
#check{
display: none;
}
.element{
max-height: 0;
overflow: hidden;
transition: max-height .5s;
}
#check:checked ~ .element{
max-height: 800px;
}
#check ~ .check-out{
display: none;
}
#check ~ .check-in{
display: inline;
}
#check:checked ~ .check-in{
display: none;
}
#check:checked ~ .check-out{
display: inline;
}