When the page uses IFRAME, set the body width in the CSS style sheet and set its width directly on the page.

Source: Internet
Author: User

When using IFRAME on the page, setting the body width in the CSS style sheet and directly setting its width on the page results in different results.

Body {
Background-color: # ffffff;
Font-family: "";
Font-size: 12px;
Line-Height: 150%;
Clear: both;
Width: 1004px;
Margin: 10px auto;
Padding: 10px auto;
}

After setting the body width, we can see that the IFRAME width is also increased, which leads to incomplete display of the IFRAME content (if the IFRAME is set, no scroll bar appears );

<Body style = "width: 1004px;">

Set the body width directly on the page as shown above to get the correct effect.

Summary: I think IFRAME is also a Web page. The browser may also have a "body" tag when parsing it, setting the body width in the CSS style sheet changes both the page body and IFRAME body. The above is just speculation. I hope you will encounter similar problems to 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.