使用 bootstrap 的全高正文中的多个可滚动 div

Multiple scrollable div inside full height body using bootstrap

我正在尝试使用 bootstrap 创建一个如图 1 所示的 html 布局。

Figure 1

我正在尝试使用 bootstrap row col 类 对布局进行编码,但经过多次尝试后,我仍然不知道如何使用 bootstrap.

来完成它

如果有人能指导我那就太好了。

<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>

这不完全是一个答案,我添加它是为了提供更多的想法和指导。因为这是一个非常相对的要求。每个 child 都有很多问题要问,例如,侧边栏是固定宽度还是自动?点击下方按钮进行测试。

.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>