使用iframe内嵌一个显示新闻的框

使用iframe内嵌一个新闻框

属性 描述
frameborder 0,1 规定是否显示框架周围的边框
name frame_name 规定iframe的名称
scrolling yes, no, auto 规定是否在iframe中显示滚动条(分别是始终显示、始终不显示、当内容超过边界时显示)
scr URL 规定iframe中显示的文档的URL
width ~px或~% 规定iframe的宽度(可以使用像素或百分比)
height ~px或~% 规定iframe的高度(可以使用像素或百分比)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>内嵌框架</title>
</head>
<body>

    <!--
    iframe:内嵌框架
     -->

    <iframe name="topFrame" scrolling="auto" border="1" src="http://www.baidu.com" height="300px" width="100%">
        //如果你看到该文字,说明该浏览器不支持iframe
    </iframe>

    <!-- 设置当点开链接时, 在内嵌框架中打开页面-->
    <p><a href="http://www.sina.com" target="topFrame">新浪</a>&nbsp;&nbsp;&nbsp;
    <a href="http://www.baidu.com" target="topFrame">百度</a>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_42082236/article/details/81026299
今日推荐