Tag HTML <objeto>


Exemplo

Uma imagem incorporada:

<object data="pic_trulli.jpg" width="300" height="200"></object>

Exemplo

Uma página HTML incorporada:

<object data="snippet.html" width="500" height="200"></object>

Exemplo

Um vídeo incorporado:

<object data="video.mp4" width="400" height="300"></object>

Definição e uso

A <object>tag define um contêiner para um recurso externo.

O recurso externo pode ser uma página da Web, uma imagem, um media player ou um aplicativo de plug-in.

Para incorporar uma imagem, é melhor usar a <img>tag.

Para incorporar HTML, é melhor usar a <iframe>tag.

Para incorporar vídeo ou áudio, é melhor usar as tags <video>e .<audio>


Suporte ao navegador

Element
<object> Yes Yes Yes Yes Yes

Plug-ins

A <object>tag foi originalmente projetada para incorporar plug-ins do navegador.

Plug-ins são programas de computador que estendem a funcionalidade padrão do navegador.

Os plug-ins têm sido usados ​​para muitas finalidades diferentes:

  • Executar applets Java
  • Executar controles ActiveX
  • Exibir filmes em Flash
  • Exibir mapas
  • Verificar vírus
  • Verificar um ID bancário

Aviso !

A maioria dos navegadores não suporta mais Java Applets e Plug-ins.

Os controles ActiveX não são mais suportados em nenhum navegador.

O suporte para Shockwave Flash também foi desativado em navegadores modernos.


Atributos

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

Atributos Globais

A <object>tag também suporta os Atributos Globais em HTML .


Atributos do evento

A <object>tag também suporta os atributos de evento em HTML .


Páginas relacionadas

Tutorial HTML: Elemento de objeto HTML

Referência HTML DOM: Objeto Objeto


Configurações padrão de CSS

A maioria dos navegadores exibirá o <object>elemento com os seguintes valores padrão:

object:focus {
  outline: none;
}