0

I've made a div layout that looks and works exactly as I want it to do, in all browsers (haven't tested Safari), but not Chrome (!?).

HTML:

<div class="app-wrapper">
  <div class="page-header">
    header
  </div>
  <div class="page-content">
    <div class="component-container">
      <div class="list-container">
        <!-- lots of list items -->
      </div>
      <div class="content-container">
        <!-- lots of content -->
      </div>
    </div>
  </div>
</div>

CSS:

.app-wrapper
  height: 100%
  display: flex
  flex-direction: column

.page-header
  flex: 0 0 auto
  height: 80px

.page-content
  flex: 1 1 auto
  position: relative
  overflow: auto

.component-container
  display: flex
  height: 100%

.list-container
  height: 100%
  overflow: auto

.content-container
  width: 100%
  height: 100%
  overflow: auto

Here is a CodePen

Whats wrong and what can I do to make the list (yellow) and content (green) have their own overflow scroll like in all other browsers?

Thanks!

1 Answer 1

2

Give page content a specific height otherwise its children will take full 100% browser height.

.page-content {
     height: 100%;
     ...
Sign up to request clarification or add additional context in comments.

1 Comment

Wow, I should probably take a break =P Thanks a lot, that did the trick!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.