How does the CSS overflow property implement scroll bar settings and hide scroll bars?

Source: Internet
Author: User
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.