iframe套殼別的網(wǎng)站,實(shí)現(xiàn)站中站網(wǎng)頁(yè)
如果你有個(gè)域名和服務(wù)器,但是你又想要目標(biāo)網(wǎng)站的內(nèi)容,可以選擇套殼,用html的iframe標(biāo)簽實(shí)現(xiàn)。
代碼如下
<!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>小高網(wǎng)地址發(fā)布頁(yè):www.xx8g.com 關(guān)注微信公眾號(hào):小高教學(xué)網(wǎng)</title>
<meta name="keywords" content="小高網(wǎng)" />
<meta name="description" content="小高網(wǎng)">
<link rel="shortcut icon" 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.xgw5.com" id="myiframe" scrolling="yes" onload="changeFrameHeight()" frameborder="0"></iframe>
</body>
</html>
說(shuō)明一下
以上代碼實(shí)現(xiàn),自動(dòng)適配屏幕縮放。
無(wú)邊框,帶滾動(dòng)
自動(dòng)適配目標(biāo)網(wǎng)址的SSL.
再最下方的iframe src=后方替換自己的目標(biāo)網(wǎng)址即可
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
相關(guān)文章
暫無(wú)評(píng)論...