[ZT] 100% height and 100% width XHTML flash embed

Source: Internet
Author: User

I 've been asked this question a few times in the last couple of months, so I thought I wocould put together an Example page to show how you can get Flash content to stretch to 100 percent height and width without using tables.

It's actually pretty simple. Here's some of the css I used:

Code

  /*  Hide from ie5 Mac \  */  
Html {
Height : 100% ;
Overflow : Hidden ;
}
# Flashcontent {
Height : 100% ;
}
/* End hide */
Body {
Height : 100% ;
Margin : 0 ;
Padding : 0 ;
Background-color : # Eee ;
}

SettingHtmlTag to 100% height and then placing the Flash Movie insideDivThat is also set to 100% height does the trick.

NoticeOverflow: hiddenOnHtmlElement since IE will show the scrollbar even if the page doesn't need to scroll. this line will force IE to hide any content that is outside of the browser window, and therefore hide the scrollbar as well.

To embed the Flash Movie, I used my flashobject JavaScript embed so the page will validate and I have access to all the varous flash parameters I might need to pass to the Flash Movie.

Update (01-05-2005 ):Someone pointed out a bug with this in IE 5 on Macintosh, so I 've updated the CSS a bit to make it work. current verified working browsers are: IE 6 (PC), ie 5 (MAC), Safari, Firefox (PC, Mac), Mozilla (PC, Mac), opera 7.54 (MAC ).

If you have other browsers available for testing I wocould love to know if this displays properly or not. I'm mainly interested in IE 5 and 5.5 on a PC.

Update (1-17-05 ):Tested in IE 5.01 SP2 and IE 5.5 SP2 on a PC today, and it works great.

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.