HTML about force display, hide browser scroll bar

Source: Internet
Author: User

By observing and debugging, it is found that the vertical height of the page is not overflow,

Cannot call out a vertical scroll bar,

resulting in a distance of several pixels relative to the other page center,

Make the page effect not friendly.

Solution: Force all pages to add or hide the browser's scroll bar.

The relevant CSS code is as follows:

To force the display of scroll bars:

HTML {overflow:scroll;}

Force Hide scroll bar:

HTML {Overflow:hidden;}

To hide the horizontal scroll bar of IE:

HTML {overflow-x: hidden;}

To hide the vertical scroll bar for IE:

HTML {overflow-y: hidden;}

Force display of IE's horizontal scroll bar:

HTML {overflow-x: scroll;}

To force the display of the vertical scroll bar for IE:

HTML {overflow-y: scroll;}

Force display of Mozilla's horizontal scroll bar:

HTML {overflow:-moz-scrollbars-horizontal;}

Note: Only the horizontal scroll bar is forced to appear. That is, the vertical scroll bar does not appear even if you need to display a vertical scrollbar.

Force display of Mozilla's vertical scroll bar:

HTML {overflow:-moz-scrollbars-vertical;}

Note: Only the vertical scroll bar is forced to appear. That is, the horizontal scroll bar does not appear even if you need to display a horizontal scroll bar.

Related information:

HTML about force display, hide browser scroll bar

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.