Html-iframe-tag
提供:Dev Guides
HTML-<iframe>タグ
説明
HTML <iframe>タグは、インラインフレームを作成するために使用されます。
例
<!DOCTYPE html>
<html>
<head>
<title>HTML iframe Tag</title>
</head>
<body>
<iframe src = "https://www.finddevguides.com/index" width = "100%"></iframe>
</body>
</html>
これは、次の結果を生成します-
グローバル属性
このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします
特定の属性
HTML <iframe>タグは、次の追加属性もサポートしています-
Attribute | Value | Description |
---|---|---|
align | left right top middle bottom | Specifies how to align the iframe according to the surrounding text. |
frameborder | 10 | Specifies whether or not to display border around the frame. |
height | pixels | Specifies the height of the inline frame. |
longdesc | URL | A URL to a long description of the frame contents. |
marginheight | pixels | Allows you to specify the width of the space between the left and right of the frame’s borders and the frame’s content. The value is given in pixels. For example marginwidth = "10". |
marginwidth | pixels | Specifies the margin, in pixels, between the frame’s contents and it’s left and right margins. |
name | text | Name of the frame |
sandbox html-5 | "" allow-forms allow-same-origin allow-scripts allow-top-navigation | Enables a set of extra restrictions for the content in the iframe. |
scrolling | yes no auto | Determines scrollbar action |
seamless html-5 | seamless | Specifies that the iframe should look like it is a part of the containing document |
src | URL | Location of the frame contents file |
srcdochtml-5 | HTML_code | Specifies the HTML content of the page to show in the iframe |
width | pixels | Specifies the width of the inline frame. |
イベント属性
このタグは、− link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートします。
ブラウザのサポート
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |