引导中的垂直顺序网格 [英] Vertical order grid in bootstrap
本文介绍了引导中的垂直顺序网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想只改变xs设备的列顺序,使用bootstrap
这就是我得到的结果
I want to change the column order only in xs devices with bootstrap this is what i got
<div class="container">
<div class="row">
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">column left</div>
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<div>Column right nro 1</div>
<div>Column right nro 2</div>
</div>
</div>
我想要专注于右栏,仅在xs 设备中,我需要将它们颠倒,显示第一栏右侧第二栏,然后是第一栏右侧。
I want to focus on the right column, only in xs devices i need them to be inverted showing first column right nro 2 and then column right nro 1.
推荐答案
一种方法是使用display:table和caption-side属性并将这些属性包装到xs-media规则中:
One way to do it is using display: table and caption-side property and wrap those properties into xs-media rules:
@media (max-width: 768px) {
.col-right {
display: table;
}
.col-right > div:nth-child(2) {
display: table-caption;
margin: 0 15px;
}
}
这篇关于引导中的垂直顺序网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文