Home >Web Front-end >CSS Tutorial >How to Always Show the Vertical Scrollbar in CSS?
In web design, it's desirable to have the vertical scrollbar always visible, regardless of the page's content length. Here's how to achieve this using CSS:
html { overflow: -moz-scrollbars-vertical; overflow-y: scroll; }
This code instructs the browser to:
As a result, the scrollbar will be visible at all times, becoming active when enough content is present on the page.
Update: If the above solution doesn't work, try this simplified version:
html { overflow-y:scroll; }
The above is the detailed content of How to Always Show the Vertical Scrollbar in CSS?. For more information, please follow other related articles on the PHP Chinese website!