The height caused by CSS float is 0.

Source: Internet
Author: User

Today, the IFRAME adaptive height is used in the project.

It is depressing that the IFRAME adaptive height cannot be achieved through a variety of adaptive height methods on the Internet.

After testing, the height of the obtained iframe src page (body/documentelement) is always 0.

After investigation by multiple parties, the cause is found, and the cause is quite depressing:

The general framework of the iframe src page submitted by the artist is as follows:

<Body>

<Div id = "Main"> ...... </div>

</Body>

Unfortunately, the artist added "--" to the main style.Float: left

After being float, div id = "Main" has been detached from the document stream, but it happens that there is only one such thing in the body.

Therefore, the height of the retrieved body is always 0 !!!!

--- I don't understand. There is only one main in the body. Why should the artist float it ???

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.