欢迎您 本站地址:
复制网址
手机查看
切换背景
源代码:
html编辑器
颜色值转换
点击运行
Bootstrap5 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script> <div class="container mt-3"> <h2>排序</h2> <p>用 .order 类弹性元素的视觉顺序,从 0 到 12 。</p> <p>使用 .order-sm|md|lg|xl|xxl-0-12 在不同的尺寸屏幕上实现这个效果,也可以组合这些类实现更灵活的布局。</p> <p>调整浏览器窗口大小查看效果。</p> <p><code>.order</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-3 bg-info">Flex item 1</div> <div class="p-2 order-2 bg-warning">Flex item 2</div> <div class="p-2 order-1 bg-primary">Flex item 3</div> </div> <p><code>.order-sm</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-sm-3 bg-info">Flex item 1</div> <div class="p-2 order-sm-2 bg-warning">Flex item 2</div> <div class="p-2 order-sm-1 bg-primary">Flex item 3</div> </div> <p><code>.order-md</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-md-3 bg-info">Flex item 1</div> <div class="p-2 order-md-2 bg-warning">Flex item 2</div> <div class="p-2 order-md-1 bg-primary">Flex item 3</div> </div> <p><code>.order-lg</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-lg-3 bg-info">Flex item 1</div> <div class="p-2 order-lg-2 bg-warning">Flex item 2</div> <div class="p-2 order-lg-1 bg-primary">Flex item 3</div> </div> <p><code>.order-xl</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-xl-3 bg-info">Flex item 1</div> <div class="p-2 order-xl-2 bg-warning">Flex item 2</div> <div class="p-2 order-xl-1 bg-primary">Flex item 3</div> </div> <p><code>.order-xxl</code>:</p> <div class="d-flex mb-3"> <div class="p-2 order-xxl-3 bg-info">Flex item 1</div> <div class="p-2 order-xxl-2 bg-warning">Flex item 2</div> <div class="p-2 order-xxl-1 bg-primary">Flex item 3</div> </div> </div>
运行结果:
小库提示
扫描下方二维码,访问手机版。
打赏
关闭