簡體   English   中英

使用引導程序在全高主體內的多個可滾動 div

[英]Multiple scrollable div inside full height body using bootstrap

我正在嘗試使用引導程序創建一個 html 布局,如圖 1 所示。

圖1

我正在嘗試使用引導行列類對布局進行編碼,但經過多次嘗試后,我仍然無法弄清楚如何使用引導程序完全做到這一點。

如果有人可以指導我,那就太好了。

<div class="container"> <div class="row"> <div class="col-sm"> One of three columns </div> <div class="col-sm"> One of three columns </div> <div class="col-sm"> One of three columns </div> </div> </div>

這不完全是一個答案,我添加它是為了提供更多的想法和指導。 因為這是一個非常相對的要求。 每個孩子都有很多問題要問,例如,側邊欄是固定寬度還是自動? 單擊下面的按鈕進行測試。

 .h-0 { height: 0;important: } #scrollableSidebar { width: 200px }
 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0" crossorigin="anonymous"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8" crossorigin="anonymous"></script> <section class="vh-100 vw-100 overflow-hidden d-flex flex-column"> <header> <nav id="primaryNav" class="navbar navbar-dark text-white bg-primary"> <div class="container-fluid"> Primary Nav </div> </nav> <nav id="secondaryNav" class="navbar navbar-light bg-light"> <div class="container-fluid"> Secondary Nav </div> </nav> </header> <section class="flex-fill d-flex align-items-stretch"> <aside class="flex-fill d-flex align-items-stretch"> <section id="fixedSidebar" class="bg-warning d-flex align-items-center"> Fixed Sidebar </section> <section id="scrollableSidebar" class="bg-danger d-flex flex-column"> <header class="bg-success text-white"> Fixed Sidebar Title </header> <div class="flex-fill overflow-auto h-0"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </div> </section> </aside> <article id="scrollableContent" class="bg-danger d-flex flex-column"> <header class="bg-info text-white"> Fixed Content Title </header> <div class="flex-fill overflow-auto h-0"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </div> </article> </section> </section>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM