How do you add a scroll bar to a div?

Blankman picture Blankman · May 14, 2010 · Viewed 160.2k times · Source

I have a popup that displays some results, and I want a scroll bar to be display since the results are being cutt off (and I don't want the popup to be too long).

Answer

Mitch Dempsey picture Mitch Dempsey · May 14, 2010

You need to add style="overflow-y:scroll;" to the div tag. (This will force a scrollbar on the vertical).

If you only want a scrollbar when needed, just do overflow-y:auto;