在上三章中介绍了使用华丹智能WEB报表快速开发平台的过程中,想要自己重新制作一个登陆注册页面,并且想要在登陆和注册页面的顶部和底部固定样的内容样式,使用文件引入的方式的第一种方式-使用import引入、第二种方式-使用js引入和第三种方式include引入,下面介绍第四种引入方式:
4、object引入和iframe引入
(1)创建三个文件 :top.html,bottom.html,index.html,top.html和bottom.html代码和之前,这里就不做赘述了。
(2)index.html的内容为:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>正文信息</title>
</head>
<body>
<!--object引入,相当于把整个页面拉过来(在一个html中嵌套另一个html),包括title,meta,body,html等-->
<!--此处的高是嵌套进去的整个html的高,不包括边框,padding等-->
<object style="border:1px solid red" type="text/x-scriptlet" data="top.html" width="100%" height="200px"></object>
<span id="indexTxt">这里是正文信息</span>
<object style="border:1px solid red" type="text/x-scriptlet" data="bottom.html" width="100%" height="200px"></object>
<!--iframe引入,同object方式一样,页面整个嵌套,默认高度为150,frameborder设置为1时边框宽度为2-->
<iframe marginwidth=0 marginheight=0 width="100%" height=200 src="top.html" frameborder="no" <!--scrolling="no"-->></iframe>
<span id="indexTxt">这里是正文信息</span>
<iframe marginwidth=0 marginheight=0 width="100%" height=200 src="bottom.html" frameborder="no" <!--scrolling="no"-->></iframe>
</body>
</html>
(3)运行结果如下:
(4)总结
这种方案引入效果看起来和之前相同,实际上如果内容超过object或者iframe的限定高度或宽度,就会出现滚动条,影响视觉效果。
华丹智能WEB报表快速开发平台的确很好用,有兴趣也可以看一下,网址https://www.huadaninfo.com/