源代碼
點擊運行
<!DOCTYPE html> <html> <head> <title>Bootstrap 實例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>響應式浮動</h2> <p>重置瀏覽器大小查看傚果。</p> <p>我們看可以設置浮動 (.float-*-left|right - * 為 sm, md, lg 或 xl)的方向依賴於屏幕的大小:</p> <div class="float-sm-right">在大於小屏幕尺寸上右浮動</div><br> <div class="float-md-right">在大於中等屏幕尺寸上右浮動</div><br> <div class="float-lg-right">在大於大屏幕尺寸上右浮動</div><br> <div class="float-xl-right">在大於超大屏幕尺寸上右浮動</div><br> <div class="float-none">沒有浮動</div> </div> </body> </html>
運行結果