The problem that the Iframe frame displays a horizontal scroll bar in IE6

Source: Internet
Author: User

How to hide the horizontal scroll bar bug in IE6 on frameset, iframe, and frame framework pages

When you use a frame (frameset, frame, iframe) to nest a webpage, if the height of the Child webpage exceeds the preset height, the scroll bar, that is, the size overflow, will appear, generally, a vertical scroll bar appears when the height is exceeded, and a horizontal scroll bar appears when the width is exceeded. However, in IE6, as long as the size is greater than or equal to the predefined height, two scroll bars will appear together, this seems like a bug.

Solution:
Set css on the sub-page as follows: the most important thing in this section is to set overflow-y to scroll. In this way, if a vertical scroll bar is forced to appear, the horizontal scroll bar will not be displayed, if the width is too large, the horizontal scroll bar will still exceed. In this case, you can set overflow-x: hidden;, but accordingly, the user cannot scroll the subpage.

Copy to ClipboardReference: [www.bkjia.com] html {
Overflow-y: auto! Important;
* Overflow-y: scroll;
}

 

The reason for adding overflow-y: auto! Important;, because IE7 does not have this bug, and firefox can recognize overflow-y, which is said to be the private attribute of IE ......, So we need to set overflow back.

The above method can be improved.
Since only IE6 has this BUG, you can only write it for IE6.
Html {_ overflow-y: scroll ;}
_ Underline is proprietary to IE6, saving a line of code and Improving Efficiency

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.