Home > Web Front-end > H5 Tutorial > Two solutions to why HTML5 does not support frameset

Two solutions to why HTML5 does not support frameset

黄舟
Release: 2017-02-21 13:33:03
Original
3806 people have browsed it

The solution is as follows:

The first one

uses iframe, but currently fewer and fewer people use iframe. Moreover, iframes are incompatible between different browsers. And some of my R&D personnel said that transferring values ​​between iframe windows seems troublesome.

Second option

Use jQuery's onload method to load the page. However, after this method jumps to multiple pages, clicking the back and forward button above the browser is invalid. , but you can think of adding a back button.

So personally I prefer this method.

I usually write like this

$("#main").load("mainIndex.html",function(){

 });
Copy after login



For pages, p+css can achieve the effect of frame

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>p+css实现frameset效果</title>
<style type="text/css">
.header{border-bottom:1px solid #ccc;margin-bottom:5px;}
.MainContainer{min-width:960px;max-width:1600px;}
.sidebar{width:180px;float:left;margin-right:-180px;border-right:1px solid #ccc;min-height:500px;padding:5px;}
.main{float:left;margin-left:200px;padding:5px;}
.content{padding:0 10px;}
</style>
</head>
<body>
    <p class="page">
        <p class="header">
            <p id="title">
                <h1>顶部</h1>
            </p>
        </p>
        <p class="MainContainer">
            <p class="sidebar">
            边栏
            </p>
            <p  id="main" class="main">
                内容
            </p>           
        </p>
    </p>
</body>
</html>
Copy after login



Summary

The above are the two solutions for HTML5 not supporting frameset, more related Please pay attention to the PHP Chinese website (www.php.cn) for content!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template