W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</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>网格实例</h1> <p>本例展示了一个简单的“堆叠到水平”的两列布局,这意味着它会在所有屏幕上产生 50%/50% 的拆分,除了超小型屏幕,它会自动堆叠 (100%):</p> <p>请调整浏览器窗口大小来查看效果。</p> <div class="row"> <div class="col-sm-6 bg-primary text-white p-3"> Lorem ipsum... </div> <div class="col-sm-6 bg-dark text-white p-3"> Sed ut perspiciatis... </div> </div> </div> </body> </html>