1

https://jsfiddle.net/7hb50ugv/4/

My html looks like this:

<div class="fullpage" id="main">
  <header>header</header>
  <section>
    <div>
      <ul>
        <li>result</li>
        <li>result</li>
        <li>lots more results</li>
        <li>...</li>
      </ul>
    </div>
    <div>
      <ul>
        <li>result</li>
        <li>result</li>
        <li>result</li>
        <li>result</li>
      </ul>
    </div>
  </section>
</div>

I'm using multiple nested Display: grid for my layout. Here's the css

.fullpage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#main {
    background: #f0f0f0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "head" "body";
}

header {
  height: 50px;
  background: green;
}

section {
  display: grid;
  grid-template-columns: 500px 500px 1fr;
}

section > div {
  overflow-y: auto;
}

The problem that I'm having is, in my section element, I was hoping to get the children-divs independently scrolling. But it's not panning out the way I wanted -- the divs are stretching beyond the height of the parent container and I can't make them scrollable.

TKoL
  • 13,158
  • 3
  • 39
  • 73

0 Answers0