79723334

Date: 2025-08-02 11:44:11
Score: 1
Natty:
Report link

Looks like this, right?

enter image description here

To make a child `div` scrollable is to give it a fixed or constrained height. To achieve it, apply `

overflow: auto 
or
overflow-y: scroll

Here's an example CSS:

.layout-container {
  display: flex;
  height: 100vh; /* => Fill the full screen */
}

.sidebar-scrollable {
  width: 250px; 
  height: 100%;  /* => Fill the parent height */
  overflow-y: auto; /* => Enable vertical scrolling */
  padding: 10px;
  box-sizing: border-box;
  background-color: #f9f9f9;
}

.main-content {
  flex: 1;
  padding: 20px;
}

Hopefully, this will help

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: hgq287