iframe套壳别的网站,实现站中站网页-经验交流论坛-轻友天地-轻论坛

iframe套壳别的网站,实现站中站网页

如果你有个域名和服务器,但是你又想要目标网站的内容,可以选择套壳,用html的iframe标签实现。

代码如下

<!DOCTYPE html>
<html lang="zh">
<head>
 
 
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="main.css">
 
  <title>轻论坛-专注主题美化</title>
  <meta name="keywords" content="轻论坛" />
  <meta name="description" content="轻论坛">
  
  <link rel="shortcut icon" href="http://www.qingluntan.cn/favicon.ico" type="image/x-icon">
  
 
  
  <style>
    body {
      margin: 0;
      padding: 0;
    }
    #myiframe {
      width: 100%;
      height: 100vh;
      border: none;
    }
  </style>
  <script>
    function changeFrameHeight() {
      var ifm = document.getElementById("myiframe");
      ifm.height = document.documentElement.clientHeight;
    }
    window.onresize = function() {
      changeFrameHeight();
    };
  </script>
</head>
<body>
  <iframe src="https://www.qingluntan.cn" id="myiframe" scrolling="yes" onload="changeFrameHeight()" frameborder="0"></iframe>
</body>
</html>

说明一下

以上代码实现,自动适配屏幕缩放。

无边框,带滚动

自动适配目标网址的SSL.

再最下方的iframe src=后方替换自己的目标网址即可

请登录后发表评论

    没有回复内容


Warning: error_log(/www/wwwroot/www.qingluntan.cn/wp-content/plugins/spider-analyser/#log/log-2907.txt): failed to open stream: No such file or directory in /www/wwwroot/www.qingluntan.cn/wp-content/plugins/spider-analyser/spider.class.php on line 2900