W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container-fluid mt-3"> <h1>Mix 和 Match</h1> <p>请调整浏览器窗口大小来查看效果。</p> <p>此例演示了在超小型设备上的 50%/50% 拆分和在更大设备上的 75%/25% 拆分。</p> <div class="container-fluid"> <div class="row"> <div class="col-6 col-sm-9 bg-success">col-6 col-sm-9</div> <div class="col-6 col-sm-3 bg-warning">col-6 col-sm-3</div> </div> </div> <br> <p>此例演示了在超小型、小型和中型设备上的 58%/42% 拆分以及在大型和超大型设备上的 66.3%/33.3% 拆分。</p> <div class="container-fluid"> <div class="row"> <div class="col-7 col-lg-8 bg-success">col-7 col-lg-8</div> <div class="col-5 col-lg-4 bg-warning">col-5 col-lg-4</div> </div> </div> <br> <p>此例演示了小型设备上的 25%/75% 拆分、中型设备上的 50%/50% 拆分以及大型和超大设备上的 33%/66% 拆分。在超小型设备上,它将自动堆叠 (100%)。</p> <div class="container-fluid"> <div class="row"> <div class="col-sm-3 col-md-6 col-lg-4 bg-success">col-sm-3 col-md-6 col-lg-4</div> <div class="col-sm-9 col-md-6 col-lg-8 bg-warning">col-sm-9 col-md-6 col-lg-8</div> </div> </div> </div> </body> </html>