gpt4 book ai didi

html - 根据页面大小将 Iframe 宽度和高度设置为 100% 无效

转载 作者:太空宇宙 更新时间:2023-11-04 04:34:56 26 4
gpt4 key购买 nike

我试过下面的代码。但它没有以正确的方式显示 iframe。 Iframe 的高度和宽度很小。 iframe 应根据页面大小采用高度和宽度。

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
#left {
float: left;
}

#right {
float: left;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div >
<div id="left">
<asp:Button runat="server" ID="b1" OnClick="b1_Click" Text="Click" />
</div>
<div id="right">
<iframe id="ifr1" runat="server" style="width: 100%; height: 100%" />
</div>
</div>
</form>
</body>
</html>

最佳答案

这是您要找的吗:http://jsfiddle.net/David_Knowles/jFVsr/

html, body {height: 100%; width: 100%; padding: 0; margin: 0; background-color: red;} 

编辑:现在 iframe 填满了整个屏幕。

#left {float: left; width: 100%;}
#right {float: left; width: 100%;}
#form1 {background-color: beige; overflow:hidden; height: 100%;}
#ifr1 {border:none; height: 100%;}

关于html - 根据页面大小将 Iframe 宽度和高度设置为 100% 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16588333/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com