关于HTML代码中iframe能否截取网页的某一部分,嵌入自己的网页呢?

比如我只想截取 http://www.weather.com.cn/html/weather/101280301.shtml网页中的天气这一部分,代码怎么写!

使用iframe可以截取网站的部分内容,主要配合width、height、overflow等属性来实现的,具体示例如下:
<div style="width:630px;height:350px;overflow:hidden;border:0px">
<div style="width:800px;height:800px;margin:-810px 0px 0px -10px;">
<iframe src="要截取的网址" width="960" height="1280" scrolling="no"></iframe>
</div>
</div>

以上代码中的width 和height分别代表宽度和高度,具体值需要根据具体网页来更改。
温馨提示:内容为网友见解,仅供参考
第1个回答  2012-03-28
<iframe src="http://www.weather.com.cn/html/weather/101280301.shtml" vspace="-200" hspace="-800" scrolling="no" height="630" width="100%" frameborder="0"></iframe>

修改数值:vspace="-200" hspace="-800"
第2个回答  2012-03-27
<iframe name="right" class="right" src="http://www.weather.com.cn/html/weather/101280301.shtml"></iframe>本回答被提问者采纳
相似回答