HTML <オブジェクト>タグ
例
埋め込み画像:
<object data="pic_trulli.jpg" width="300" height="200"></object>
例
埋め込まれたHTMLページ:
<object data="snippet.html" width="500" height="200"></object>
例
埋め込みビデオ:
<object data="video.mp4" width="400" height="300"></object>
定義と使用法
<object>
タグは、外部リソースのコンテナを定義します。
外部リソースには、Webページ、画像、メディアプレーヤー、またはプラグインアプリケーションがあります。
画像を埋め込むには、<img>
タグを使用することをお勧めします。
HTMLを埋め込むには、<iframe>
タグを使用することをお勧めします。
ビデオまたはオーディオを埋め込むには、<video>
および<audio>
タグを使用することをお勧めします。
ブラウザのサポート
Element | |||||
---|---|---|---|---|---|
<object> | Yes | Yes | Yes | Yes | Yes |
プラグイン
この<object>
タグは元々、ブラウザのプラグインを埋め込むために設計されました。
プラグインは、ブラウザの標準機能を拡張するコンピュータプログラムです。
プラグインはさまざまな目的で使用されてきました。
- Javaアプレットを実行する
- ActiveXコントロールを実行する
- Flashムービーを表示する
- マップを表示する
- ウイルスをスキャンする
- 銀行IDを確認する
警告 !
ほとんどのブラウザは、Javaアプレットとプラグインをサポートしなくなりました。
ActiveXコントロールは、どのブラウザでもサポートされなくなりました。
最近のブラウザでは、ShockwaveFlashのサポートもオフになっています。
属性
Attribute | Value | Description |
---|---|---|
data | URL | Specifies the URL of the resource to be used by the object |
form | form_id | Specifies which form the object belongs to |
height | pixels | Specifies the height of the object |
name | name | Specifies a name for the object |
type | media_type | Specifies the media type of data specified in the data attribute |
typemustmatch | true/false | Specifies whether the type attribute and the actual content of the resource must match to be displayed |
usemap | #mapname | Specifies the name of a client-side image map to be used with the object |
width | pixels | Specifies the width of the object |
グローバル属性
この<object>
タグは、HTMLのグローバル属性もサポートしています。
イベント属性
この<object>
タグは、HTMLのイベント属性もサポートしています。
関連ページ
HTMLチュートリアル:HTMLオブジェクト要素
HTML DOMリファレンス:オブジェクトオブジェクト
デフォルトのCSS設定
ほとんどのブラウザは<object>
、次のデフォルト値で要素を表示します。
object:focus {
outline: none;
}