iframe 用于在網頁內顯示網頁。
<iframe src="URL"></iframe>
URL 指向隔離頁面的位置。
height 和 width 屬性用于規定 iframe 的高度和寬度。
屬性值的默認單位是像素,但也可以用百分比來設定(比如 "80%")。
<iframe src="demo_iframe.htm" width="200" height="200"></iframe>
親自試一試
frameborder 屬性規定是否顯示 iframe 周圍的邊框。
設置屬性值為 "0" 就可以移除邊框:
<iframe src="demo_iframe.htm" frameborder="0"></iframe>
親自試一試
iframe 可用作鏈接的目標(target)。
鏈接的 target 屬性必須引用 iframe 的 name 屬性:
<iframe src="demo_iframe.htm" name="iframe_a"></iframe><p><a href="http://www.49028c.com/" target="iframe_a">www.49028c.com</a></p>
親自試一試
標簽 | 描述 |
---|---|
<iframe> | 定義內聯的子窗口(框架) |
新聞熱點
疑難解答