0
我想以不同的方式将我的列与他们的HTML源代码顺序对齐。我试图使用shift()来做到这一点,但我得到的问题水平对齐。波旁威士忌 - 移动列垂直对齐?
为了更好地说明我的问题,我把这个CodePen在一起: http://codepen.io/anon/pen/gaBYJB?editors=110
HTML
<h1>Resize the browser</h1>
<p>Mobile should be 1, 2, 3 stacked. But desktop should be 3, 1, 2. They do not align correctly horizontally.</p>
<div class="items">
<div class="item item_1">1</div>
<div class="item item_2">2</div>
<div class="item item_3">3</div>
</div>
SCSS
@import "bourbon";
@import "neat";
$bp: new-breakpoint(min-width 768px 12);
body {
padding: 20px;
}
.items {
@include row();
background: #333;
padding: 20px;
}
.item {
@include span-columns(12);
padding: 20px;
color: #fff;
font-size: 22px;
background: #666;
&_1 {
@include media($bp) {
@include span-columns(3);
@include shift(6);
}
}
&_2 {
@include media($bp) {
@include span-columns(3);
@include shift(9);
}
}
&_3 {
@include media($bp) {
@include span-columns(6);
@include shift(-12);
}
}
}
移动应该是1,2,3堆叠(已经很好)。但桌面应该是3,1,2。它们没有水平对齐。
如何通过正确的垂直对齐来实现此布局?项目1似乎在推动其他项目。