HTML框架

通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。

iframe语法:<iframe src="URL"></iframe>该URL指向不同的网页。

Iframe - 设置高度与宽度实例:

<!DOCTYPE html>
<html>
<body>

<iframe src="demo_iframe.htm" width="200" height="200"></iframe>

<p>Some older browsers don't support iframes.</p>
<p>If they don't, the iframe will not be visible.</p>


</body>
</html>    

效果:

Iframe - 移除边框实例:

<!DOCTYPE html>
<html>
<body>

<iframe src="http://www.w3cschool.cc/" width="200" height="200" frameborder="0">
 <p>您的浏览器不支持  iframe 标签。</p>
</iframe>

</body>
</html>

效果:frameborder 属性用于定义iframe表示是否显示边框,设置属性值为 "0" 移除iframe的边框:

使用iframe来显示目录链接页面实例:

<!DOCTYPE html>
<html>
<body>

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.w3cschool.cc" target="iframe_a">W3Cschool.cc</a></p>

<p><b>Note:</b> Because the target of the link matches the name of the iframe, the link will open in the iframe.</p>

</body>
</html>    

效果:

 

posted @ 2015-05-25 22:08  yxmvip  阅读(144)  评论(0编辑  收藏  举报