DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for How to make vertically scrollable in CSS
JT Dev for JetThoughts LLC

Posted on • Originally published at jtway.co

How to make vertically scrollable in CSS

In order for the scroll to appear, you need to limit its height by adding height or max-height properties.

.scroll-area {
  overflow-y: auto;
  max-height: 400px;
}
Enter fullscreen mode Exit fullscreen mode

If you do not add this, your block will stretch to the entire height.

Image description

Top comments (0)

Search No More

Join DEV and MongoDB and build an application with full-text search capabilities using MongoDB Atlas and Atlas Search for the DEV x MongoDB Atlas Hackathon 2022.

β†’ Join the Hackathon