gpt4 book ai didi

javascript - Bootstrap : rearrange order of different sized panels on mobile

转载 作者:行者123 更新时间:2023-11-28 03:03:58 27 4
gpt4 key购买 nike

我对如何在移动设备上重新排列面板有疑问。面板有不同的尺寸。页面大屏截图(col-lg)请见附件:

page in large panel

编辑:大屏幕布局没问题,因为我不希望行之间有任何空格,因为面板的高度不同。

当我在移动设备 (col-xs) 上查看它时,我得到:
第一版
第四版
第七版
第二版
第五版
第三版
第六幅

请查看手机屏幕的图像:

page in mobile screen

我想重新排列移动面板的位置(col-xs),所以排列是这样的:
第一版
第二版
第三版
第四版
第七版
第五版
第六版

请查看我的代码片段

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
crossorigin="anonymous">
</head>
<body>
<div class="container">

<!-- 1st panel -->
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">1st</h3>
</div>
<div class="panel-body">
1st panel<br>
1st panel<br>
1st panel
</div>
</div>
<!-- 4th panel -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">4th</h3>
</div>
<div class="panel-body">
4th panel<br>
4th panel<br>
4th panel<br>
4th panel<br>
</div>
</div>
<!-- 7th panel -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">7th</h3>
</div>
<div class="panel-body">
7th panel<br>
7th panel<br>
7th panel<br>
7th panel<br>
</div>
</div>
</div>


<!-- 2nd panel -->
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">2nd</h3>
</div>
<div class="panel-body">
2nd panel<br>
2nd panel<br>
2nd panel<br>
2nd panel<br>
2nd panel<br>
2nd panel
</div>
</div>
<!-- 5th panel -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">5th</h3>
</div>
<div class="panel-body">
5th panel<br>
5th panel<br>
5th panel<br>
5th panel<br>
</div>
</div>
</div>

<!-- 3rd panel -->
<div class="col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">3rd</h3>
</div>
<div class="panel-body">
3rd panel<br>
3rd panel<br>
3rd panel
</div>
</div>
<!-- 6th panel -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">6th</h3>
</div>
<div class="panel-body">
6th panel<br>
6th panel<br>
6th panel<br>
6th panel<br>
</div>
</div>
</div>

</div>
</body>
</html>

最佳答案

请遵循 Bootstrap 网格系统和选项。我认为使用它可以解决您的问题。

Link for Grid options

Link for Grid System

设备有预定义的尺寸。因此,您可以使每个 div 等都兼容所有设备。

关于javascript - Bootstrap : rearrange order of different sized panels on mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33384614/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com