当前位置:Gxlcms > html代码 > HTML5不支持frameset的两种解决方法

HTML5不支持frameset的两种解决方法

时间:2021-07-01 10:21:17 帮助过:76人阅读

解决方法如下:

第一种

使用iframe,但是目前使用iframe的人已经越来越少了,而且iframe在不同浏览器之间还有不兼容的情况。而且我一些研发的人员,他们表示iframe窗口间传值似乎很麻烦。

第二种

使用jQuery的onload方法加载页面,不过这种方法跳转多个页面后,点击浏览器上方的后退前进是无效的,不过可以认为的添加一个返回按钮。

所以个人更倾向于这种方法。

我一般是这样写的



对于页面,p+css可以实现frame的效果

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>p+css实现frameset效果</title>
  6. <style type="text/css">
  7. .header{border-bottom:1px solid #ccc;margin-bottom:5px;}
  8. .MainContainer{min-width:960px;max-width:1600px;}
  9. .sidebar{width:180px;float:left;margin-right:-180px;border-right:1px solid #ccc;min-height:500px;padding:5px;}
  10. .main{float:left;margin-left:200px;padding:5px;}
  11. .content{padding:0 10px;}
  12. </style>
  13. </head>
  14. <body>
  15. <p class="page">
  16. <p class="header">
  17. <p id="title">
  18. <h1>顶部</h1>
  19. </p>
  20. </p>
  21. <p class="MainContainer">
  22. <p class="sidebar">
  23. 边栏
  24. </p>
  25. <p id="main" class="main">
  26. 内容
  27. </p>
  28. </p>
  29. </p>
  30. </body>
  31. </html>



总结

以上就是HTML5不支持frameset的两种解决方法 的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!

人气教程排行