XHTML: Problems with invalid assignment of style.height in non-IE browsers

Source: Internet
Author: User
xhtml| Browser | questions

Today, I am in the long page MDI script control (mzmultipage), in IE and other browsers have been tested through no problem, but in Mozilla, Firefox, Netscape test When the problem comes, my multiple pages are in the page to use the IFRAME, these IFrame initial style.height are 0, and in the Load page, the IFRAME will adapt to the load of the page height, I was through the iframe.style.height=300 so that the height of the IFRAME, This processing in the IE series Browser does not have any problems, but in the non-IE browser anyway not work, through tracking, found that the 300 was not assigned to Style.height, the final test out should be given the assigned unit, that is iframe.style.height= " 300px ", so the assignment is valid, no units of the assignment is invalid, depressed me for a while!"

Description of the environment: I'm using the XHTML DTD, which is on the top of the page: <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd"", it is because of this xhtml1.dtd is not in IE browser style.height problems.

Another point of knowledge: in the NETSACPE of the IFRAME, if by setting style.display= "None" to hide the IFrame, the script will be dynamically written to the IFRAME HTML "flush out." So the IFRAME in Netscape if there is script to write HTML and need to dynamically hide/display this IFRAME operation, we recommend that you use the style.width= "0px" style.height= "0px"; Such a way to hide!



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.