Categories
CSS

How to make a div vertically scrollable using CSS?

Spread the love

To make a div vertically scrollable using CSS, we set the overflow-y property.

For instance, we write

<div style="overflow-y: scroll; height: 400px">...</div>

to make the div scrollable vertically with overflow-y: scroll;.

We’ve to set the div’s height for overflow-y to work.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *