Set CSS to hide the webpage's scroll bar from the Network)

Source: Internet
Author: User
Solution:

We want to force a scroll bar, but sometimes we don't want a scroll bar, so we need to hide it. From the above guidance, we can easily get the answer-set the CSS Attribute Overflow value to hidden.

Procedure:

Method 1: Set CSS overflow to hidden.

<Body style = "overflow: hidden">

Method 2: Set the scroll attribute of the Body element to No.

<Body scroll = "no">

Note:

We recommend that you use method 1 to hide the scroll bar. In method 2, you cannot use a script to scroll the page in ie5.0. Because the method only hides the scroll bar and does not display it, the method 2 is to directly set it to no scroll bar. In this example, you can set the scroll bar on the demo.htm page in the two models in the sixth chapter of this document. On ie5.0, after you use method 2 to hide the demo.htm page scroll bar, the page scroll control function will be invalid.

TIPS:

You can use overflow-X or overflow-y to hide the scroll bar either horizontally or vertically.

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.