Show scrollbar if content overflow the block

Updated at 03-Aug-2022, By samar

Show scrollbar if content overflow the block

With this article, we will examine several different instances of how to solve the "Show scrollbar if content overflow the block".

I have a div with fixed height and i want to show scrollbar when needed. I want to display the scrollbar if the content will be overflow the height of div else it will be not display.
  • Syntax

    Overflow-y : auto;
    

    You have to create a div and give a height to it and use Overflow-y : auto; property to show scrollbar if content overflow the height of block (div).

Back to code snippet queries related css