使用iframe调用指定网页的特定位置

HTML

1
2
3
<div id="container">
<iframe id="embed" src="http://www.example.com"></iframe>
</div>

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
div#container
{
width:840px;
height:317px;
overflow:scroll; /* if you don't want a scrollbar, set to hidden */
overflow-x:hidden; /* hides horizontal scrollbar on newer browsers */

/* resize and min-height are optional, allows user to resize viewable area */
-webkit-resize:vertical;
-moz-resize:vertical;
resize:vertical;
min-height:317px;
}

iframe#embed
{
width:1000px; /* set this to approximate width of entire page you're embedding */
height:2000px; /* determines where the bottom of the page cuts off */
margin-left:-183px; /* clipping left side of page */
margin-top:-244px; /* clipping top of page */
overflow:hidden;

/* resize seems to inherit in at least Firefox */
-webkit-resize:none;
-moz-resize:none;
resize:none;
}