Filling the Browser with Flash in Firefox

本文介绍了如何在不同浏览器中实现Flash内容的全屏显示,特别是解决了Firefox浏览器中百分比填充不完整的问题。通过调整HTML样式设置,确保了Flash内容能够正确地填充整个浏览器窗口。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:http://www.bit-101.com/blog/?p=523

Sometimes you need to have a full browser screen filled with a swf. Everyone knows how to do that. You go into Publish Settings, set Dimensions to “Percent” and Width and Height to 100.

The problem is that you still end up with a margin around the edge of the page. So you dive into the HTML and add in something to change the margin and padding to 0 for the body.

That works fine on many browswers, but on Firefox, maybe Mozilla too, it is totally broken. The Flash only fills about 100 pixels or so at the top of the page. After searching around, I found that Mozilla is very strict about its percentages. You are telling the swf to take up 100%, but 100% of what? The swf is in the body tag. The body tag is in the html tag, which is in the browser window. Most browsers will scale the html size to fill the browser window and scale the body to fill the html size.

Not so with Mozilla/Firefox. It doesn’t assume that html fills 100% of the browswer, or that body fills 100% of the html. So you have to tell it that.

The following little snippet in a styles tag in the html head handles all of this:

body,html {
margin:0px;
padding:0px;
height:100%;
}
I actually put this right into the default.html file in the templates Flash uses to create its html. Of course you have to take it out if you don’t need it, but I found it easier to delete than have to remember when I need it. That’s just me. If I were really organized, I’d create a whole new template for this purpose.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值