源代码 -->
左右布局
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <title>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> </head> <body> <div class="container mt-3"> <h2>响应式浮动</h2> <p>可以根据屏幕尺寸来设置浮动效果(.float-*-left|right - * 表示 sm (>=576px), md (>=768px), lg (>=992px), xl (>=1200px) or xxl (>=1400px)):</p> <p>重置浏览器查看效果</p> <div class="clearfix"> <div class="float-sm-end">小屏幕向右浮动</div><br> <div class="float-md-end">中等屏幕向右浮动</div><br> <div class="float-lg-end">大屏幕向右浮动</div><br> <div class="float-xl-end">超大屏幕向右浮动</div><br> <div class="float-xxl-end">特大屏幕向右浮动</div><br> <div class="float-none">没有浮动</div> </div> </div> </body> </html>
运行结果