在 Bootstrap 中巢狀列
要使用預設網格巢狀內容,請在新 .row 中新增新的 .col-md-* 列,並在現有的 .col-md-* 列內設定一組 .col-md-* 列。
您可以嘗試執行以下程式碼以瞭解如何在 Bootstrap 中實現巢狀列 −
例項
<!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 = "box"> <h1>Heading</h1> <div class = "row"> <div class = "col-md-3" style = "background-color: gray; color: white; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <h4>Heading</h4> <p>This is demo text.</p> </div> <div class = "col-md-9" style = "background-color: gray;color: white; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <h4>Heading</h4> <p>This is demo text.</p> <div class = "row"> <div class = "col-md-6" style = "background-color: orange; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <p>This is box 1.</p> </div> <div class = "col-md-6" style = "background-color: orange; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <p>This is box 2.</p> </div> </div> <div class = "row"> <div class = "col-md-6" style = "background-color: orange; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <p>This is box 3.</p> </div> <div class = "col-md-6" style = "background-color: orange; box-shadow: inset 1px -1px 1px #444, inset -1px 1px 1px #444;"> <p>This is box 4.</p> </div> </div> </div> </div> </div> </body> </html>
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言
C++
C#
MongoDB
MySQL
Javascript
PHP