Show scrollbar if content overflow the block

Created 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

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.