首页 > 开发 > HTML > 正文

如何用div语法在一个html里插入另外一段html(或者文件)代码并完整显示

2017-09-09 13:30:17  来源: 网友分享


这个是写出来的效果

这个是原图html效果

<iframe src="test12.html" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="iFrameHeight()" ></iframe>
这个是代码
请问怎么才能显示完整呢?
方便的话请提供一下完整代码。。

这里是前半段的代码
<!DOCTYPE html>
<html>
<head>

<title>data</title><meta charset="utf-8"><meta name="author" content="2" /><link rel="stylesheet" href="zh-CN.css" type="text/css" />

</head>
<body>

<textarea id="source">

class: center, middle, inverse, title-slide

data

1

2

3


<iframe src="test12.html" id="iframepage" name="iframepage" frameBorder=0 scrolling=no width="100%" onLoad="iFrameHeight()" ></iframe>


class: inverse, center, middle

解决方案

试试这个可以吗

function iFrameHeight() {    document.getElementById("iframepage").style.height = window.frames['iframepage'].document.documentElement.scrollHeight + 'px';}