2

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.

4

1 に答える 1

3

標準モードで、静的に配置された要素をビューポートと同じ高さにしたい場合、その要素とすべての祖先(およびを含む可能性がbodyありhtmlます)にはCSSが必要height: 100%です。高さは親の100%サイズを基準にしており、親に明示的な高さがない場合、パーセンテージは無意味です。

絶対位置の要素をビューポートと同じ高さにしたい場合は同じですが、すべての要素の代わりにブロックを含む位置に配置されます。ビューポートと要素の間にブロックが含まれていない可能性があるため、この場合は通常は簡単です。

クァークズモード(Doctypeを削除すると得られるもの)では、height: 100%多くの場合、あまり役に立たない多くのバグの中で、異なる効果があります。

于 2010-11-10T21:17:20.257 に答える