要使用流体容器创建堆叠为水平网格的网格,请使用容器流体类。
此类允许容器跨越屏幕的整个宽度。
您可以尝试运行以下代码以使用流体容器创建网格-
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class = "container-fluid"> <h1>Grid</h1> <div class = "row"> <div class = "col-sm-6" style = "background-color:blue; color: white"> This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div> <div class = "col-sm-6" style = "background-color:red; color: white"> This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div> </div> </div> </body> </html>