开发者

DOCTYPE html PUBLIC DTD XHTML 1.0 Transitional

In the master page of mine the above line exists

<!DOCTYPE html PUBLIC "-//W3C//开发者_运维知识库DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

But why is it getting me problems?

In a content page i am embedding an SWF object

var flashvars = {xmlPath: "xml/" + GetQueryString("x") + ".xml" };
  var params = { allowFullScreen: "true", wmode: "transparent" };
  var attributes = {};
  swfobject.embedSWF("main.swf", "gallery", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

If i comment out the DOCTYPE "line" the SWF object fills the screen (As it should). If i DO NOT comment out the DOCTYPE "line" the SWF object fills only in horizontal direction.

So what is going on here? Could i have both DOCTYPE and the SWF object tiled in both vertical and horizontal direction?

UPDATE: And here is the CSS that is applied without success

<style type="text/css">
*{
margin:0;
padding:0;
}
html, body, #gallery { background: #EFEFEF; height:100%; }
body { margin:0; padding:0; overflow:hidden; }
</style>

ANOTHER UPDATE: In Chrome it works great, in Internet explorer the SWF fills 20% of the display and is placed at the top of the page and finally in Firefox, nothing is displayed.


In Standards Mode, if you want a statically-positioned element to be the same height as the viewport, it and all ancestors (potentially including body and html) have to have a CSS height: 100%. The 100% height is relative to the size of the parent, and if the parent doesn't have an explicit height, percentages are meaningless.

If you want an absolutely-positioned elements to be the same height as the viewport it's the same but with positioned containing blocks instead of every element. This case is usually easier as there may not be any containing blocks between the viewport and the element.

In Quirks mode (which is what you get when you remove the doctype), height: 100% often has a different effect, amongst many typically-less-helpful bugs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜