Heim  >  Artikel  >  Web-Frontend  >  怎么让iframe的高度和宽度可以100%_html/css_WEB-ITnose

怎么让iframe的高度和宽度可以100%_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:511346Durchsuche

html的代码如下,其中有2个div,一个宽度是200px。另一个div里有个Iframe,不论我怎么设置样式都不能让这个Iframe的宽度自动达到100%,只能设置个定值。现在默认的Iframe宽度和高度都很小,大概只有200px。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head>	<title></title>	<style type="text/css">        html, body        {            width: 100%;            height: 100%;        }  </style>	</head><body><div class="dtree" style="position: absolute; left: 0px; top: 0px; width: 200px;  height: 100%; padding: 5px; overflow: auto;"></div><div style="position: absolute; left: 205px; top: 10px;" width="100%" height="100%">	<Iframe name="tt" style="height=100%; width=80%" src="" marginwidth="1" marginheight="1"	scrolling="yes" frameborder="10"></Iframe></div></body></html>


回复讨论(解决方案)

这个是 高度自适应 根据内容来伸缩的。

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档
<script></script>



  





 

 

    



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn