CSS:
a, label {
display: block;
border-bottom: 1px solid #ccc;
padding: 1em 2em;
100%;
color: #000;
text-decoration: none;
cursor: pointer;
}
.all-items {
display: none;
}
.show-all {
display: none;
}
.list {
position: relative;
padding-bottom: 3.188em;
}
label {
position: absolute;
bottom: 0;
}
label:before {
content: "More";
}
.show-all:checked ~ .all-items {
display: block;
}
.show-all:checked + label:before {
content: "Less";
}
HTML:
<div class="list">
<a href="#">Micket</a>
<a href="#">Mace Windu</a>
<a href="#">Count Dooku</a>
<a href="#">Admiral Ackbar</a>
<a href="#">Padme Amidala</a>
<input id="show-all" class="show-all" type="checkbox" />
<label for="show-all"></label>
<div class="all-items">
<a href="#">Gamorrean Guards</a>
<a href="#">C-3P0</a>
<a href="#">Qui-Gin Jinn</a>
<a href="#">Imperial Guards</a>
<a href="#">Obi-Wan Kenobi</a>
<a href="#">Tie Fighter Pilot</a>
<a href="#">Greedo</a>
</div>
</div>
不兼容IE6、7、8
转自:http://modernweb.com/2014/07/30/5-things-wont-believe-built-css/