推是在CSS 左:X%和拉是在CSS 右:X%。我認爲,divs消失了,因爲它們是太遠了或者它們是在相同的地方。
我認爲,在這種情況下,你不能使用拉和推。
如果你想要它與完整的字母表,你必須使用位置絕對 sm爲每個列。
對於A-M留在left: 0
左側。對於N - Z留在right: 0
右側。您可以將更改爲另一個值。而且你必須給每個列表一個top
。否則它不起作用。
CSS
@media screen and (min-width: 768px) and (max-width: 992px) {
.alpha > .row > div {
position: absolute;
}
.left-sm {
left: 0;
}
.right-sm {
right: 0;
}
/* left side */
.alpha > .row:nth-of-type(1) > div:nth-of-type(1) {
top: 0px; /* A */
}
.alpha > .row:nth-of-type(1) > div:nth-of-type(2) {
top: 50px; /* B */
}
.alpha > .row:nth-of-type(1) > div:nth-of-type(3) {
top: 100px; /* ... */
}
.alpha > .row:nth-of-type(1) > div:nth-of-type(4) {
top: 150px;
}
.alpha > .row:nth-of-type(2) > div:nth-of-type(1) {
top: 200px;
}
.alpha > .row:nth-of-type(2) > div:nth-of-type(2) {
top: 250px;
}
.alpha > .row:nth-of-type(2) > div:nth-of-type(3) {
top: 300px;
}
.alpha > .row:nth-of-type(2) > div:nth-of-type(4) {
top: 350px;
}
.alpha > .row:nth-of-type(3) > div:nth-of-type(1) {
top: 400px;
}
.alpha > .row:nth-of-type(3) > div:nth-of-type(2) {
top: 450px;
}
.alpha > .row:nth-of-type(3) > div:nth-of-type(3) {
top: 500px;
}
.alpha > .row:nth-of-type(3) > div:nth-of-type(4) {
top: 550px;
}
.alpha > .row:nth-of-type(4) > div:nth-of-type(1) {
top: 600px;
}
/* right side */
.alpha > .row:nth-of-type(4) > div:nth-of-type(2) {
top: 0px; /* N */
}
.alpha > .row:nth-of-type(4) > div:nth-of-type(3) {
top: 50px; /* O */
}
.alpha > .row:nth-of-type(4) > div:nth-of-type(4) {
top: 100px; /* ... */
}
.alpha > .row:nth-of-type(5) > div:nth-of-type(1) {
top: 150px;
}
.alpha > .row:nth-of-type(5) > div:nth-of-type(2) {
top: 200px;
}
.alpha > .row:nth-of-type(5) > div:nth-of-type(3) {
top: 250px;
}
.alpha > .row:nth-of-type(5) > div:nth-of-type(4) {
top: 300px;
}
.alpha > .row:nth-of-type(6) > div:nth-of-type(1) {
top: 350px;
}
.alpha > .row:nth-of-type(6) > div:nth-of-type(2) {
top: 400px;
}
.alpha > .row:nth-of-type(6) > div:nth-of-type(3) {
top: 450px;
}
.alpha > .row:nth-of-type(6) > div:nth-of-type(4) {
top: 500px;
}
.alpha > .row:nth-of-type(7) > div:nth-of-type(1) {
top: 550px;
}
.alpha > .row:nth-of-type(7) > div:nth-of-type(2) {
top: 600px;
}
}
HTML
<div class="container alpha">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">A</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">B</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">C</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">D</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">E</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">F</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">G</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">H</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">I</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">J</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">K</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">L</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 left-sm">
<div class="space well">M</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">N</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">O</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">P</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">Q</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">R</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">S</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">T</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">U</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">V</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">W</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">X</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">Y</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 right-sm">
<div class="space well">Z</div>
</div>
</div>
</div>
Demo
來源
2015-09-06 01:48:33
Sun
似乎這不是爲我工作 - 當我推B和拉C,它結束了一層將列重疊在一起。 –