HTML嵌入另外一个HTML的问题,被嵌入页面无法充满页面 一个HTML通过下面这种方式嵌入另外一个html<iframe id="aim" src="page1.html" frameBorder="0" width="100%" scrolling="yes" height="100%"></iframe>这个page1.html怎么没有充满当前页面啊。我html太菜了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是最简单的一个html里面包含另外一个html<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>页面</title> <script type="text/javascript"> </script></head><body> <iframe id="aim" src="page1.html" frameBorder="0" width="100%" scrolling="yes" height="100%"></iframe></body></html>请问在哪里设置什么外部包含高度宽度。 height属性是不支持百分比的。在page1.html里写上下面一段代码:<script language="javascript"> parent.document.getElementById("aim").height = document.body.scrollHeight + 20;</script>加号后面的数字酌情增减。 给IFRAME设一个高度。或在外面用一个有高度的DIV包起来,或给BODY设一个高度。你可以加上这个,看一下不加高度的实际效果:<style>body {width:100%;height:100%;border:solid}</style> $("#aim").load(function() { $(this).height($(this).contents().height()); });$("#aim").mouseover(function() { $(this).height($(this).contents().height()); });$("#aim").mouseout(function() { $(this).height($(this).contents().height()); });通过jquery控制 问题解决<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">把这段删掉 就OK了。 这个解决方法并不好。你可以查查关于DOCTYPE的资料。 JQUERY EASYUI 如何获取TABS的点击对象?? Microsoft JScript 运行时错误: “TABLE1_onclick”未定义 ext 高级查询问题. 100分请教判断上传图片是否存在 iframe中调用父页面,调用函数的问题 怎样设置超链接页面的‘打印设置’--在线 预先加载图片 有两个Div,其中一个使用了滚动条,如何使……(急!!!在线等) 帮我解决一下这个问题 如何刷新所有弹出窗口 一个涉及较为复杂的正则的字符串替换 求解:$("td:eq(1)", $(e.target).closest("tr")).text();
就是最简单的一个html里面包含另外一个html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>页面</title> <script type="text/javascript">
</script>
</head>
<body>
<iframe id="aim" src="page1.html" frameBorder="0" width="100%" scrolling="yes" height="100%"></iframe>
</body>
</html>
请问在哪里设置什么外部包含高度宽度。
<script language="javascript">
parent.document.getElementById("aim").height = document.body.scrollHeight + 20;
</script>
加号后面的数字酌情增减。
<style>
body {width:100%;height:100%;border:solid}
</style>
$(this).height($(this).contents().height());
});
$("#aim").mouseover(function() {
$(this).height($(this).contents().height());
});
$("#aim").mouseout(function() {
$(this).height($(this).contents().height());
});通过jquery控制