javascript - Bootstrap : move div from one column to another, 移动设备订单计数

标签 javascript html css twitter-bootstrap grid

<div class="row">
    <div class="col-lg-7">
        <div>block1 with IDs and classes</div>
        <div>block2 with IDs and classes</div>
    </div>
    <div class="col-lg-5">
        <div>block3 with IDs and classes</div>
    </div>
</div>

如何让它看起来像

block1 
block3 
block2 

移动设备?

附注当然,在问我的问题之前,我先看了一下这些问题:

SO: How do I change Bootstrap 3 column order on mobile layout?

这没有帮助。 另外,为两个 block 添加 hidden-xsvisible-xs

<div>block2 with IDs and classes</div>

在不同的地方没有帮助,因为 ID 在页面上应该是唯一的。

有什么建议吗?谢谢。 例子: enter image description here

重要提示: block 3 可能(并且确实)比 block 1 更高(高度更大)。

最佳答案

无需使用推/拉。想想“移动优先”..

 <div class="row">
        <div class="col-lg-7">
            <div>block1</div>
        </div>
        <div class="col-lg-5">
            <div>block3</div>
        </div>
        <div class="col-lg-7">
            <div>block2</div>
        </div>
 </div>

http://www.codeply.com/go/jgvSJrMOnk

如果 block 3 比其他列高,请创建一个特殊的类以使其在大屏幕上向右浮动。

@media (min-width:1200px) {
    .pull-lg-right {
      float:right;
    }
}

相关:
How do I change Bootstrap 3 div column order
Bootstrap with different order on mobile version ( Bootstrap 4)

关于javascript - Bootstrap : move div from one column to another, 移动设备订单计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39272173/

相关文章:

javascript - Firefox 中是否有某种组合键会干扰 Javascript/jQuery?

javascript - 如何在标签内附加 SVG 圆圈

html - 带有文本背景剪辑的 CSS 背景渐变在 Internet Explorer 中不起作用

css - 为什么 Bootstrap 表不使用 Angular 7 中的样式?

javascript - 如果存在覆盖(元素显示 : block) push element underneath down

javascript - 使用 JQuery,是否可以在 DOM 元素调用 .remove() 时运行函数?

javascript - 在 HTML 中更改页面

java - JFreeChart表格的X轴?

javascript - 如何添加 PHP 或 JavaScript 代码以从下拉菜单中选择新 URL

html - CSS block (div)背景图片和负边距