下图为效果图:
原理:
设置iframe宽高足够使其不产生滚动条,通过定位移动需显示目标的位置
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.bg {
background-color: beige;
}
.content {
margin-top: 100px;
margin-left: 300px;
position: relative;
overflow: hidden;
width: 250px;
height: 204px;
}
iframe {
width: 500px;
height: 900px;
position: absolute;
top: -148px;
left: -129px;
}
</style>
</head>
<body class="bg">
<div class="content">
<iframe src="https://graph.qq.com/" frameborder="0"></iframe>
</div>
</body>
</html>