This article focuses on how to use the overflow property in CSS to set the horizontal vertical scroll bar and hide the scroll bar as required. When we design the Web page development, we sometimes need to add a scrollbar style to the specified section on the specified page, obviously we all know that the reason to use the scroll bar is because we read too much, in order to facilitate the user to read, set the scroll bar so as to be able to pull the overflow page content.
However, in visually pleasing terms, scrollbars can sometimes be better hidden.
Let's give you a detailed description of the code examples below.
The specific code example for the overflow property setting scroll bar in CSS is as follows:
<! DOCTYPE html>
The above code accesses the effect as shown in the browser:
As we can see, when we add overflow scroll style properties to A1, vertical and vertical scrollbars appear, and if the text is too large to display in a fixed-size div block, you can pull the scroll bar to see what's left.
The scroll property in overflow represents the scrollbar setting.
When we add CSS overflow hidden style attributes to A2, all the scrollbars are removed. And the remainder of the text has no way to view. Let's look at the A3 style, where we've added the Overflow-x:hidden style property, and we've hidden the horizontal scroll bar.
By the above description, we can know. If you want to set the scroll bar by overflow property in CSS, you can master overflow scroll Property! If you want to hide or remove horizontal or vertical scroll bars, simply understand the properties of hidden, Overflow-x, overflow-y. Overflow-x represents a horizontal scroll bar, overflow-y represents a vertical scrollbar, and hidden can be set to hide.
This article has certain reference value, hoped to have the need friend to have the help!