HTML Object (Plugin)
HTML Object is a tag used in HTML to embed multimedia content, including images, audio, video, and other types of content, into web pages.
The tag provides a way to add external content to a web page while still maintaining the overall structure and layout of the page.
HTML object is the topic at hand. Plug-ins are software programs that increase the browser’s basic capabilities.
Plug-ins were created with a wide range of purposes:
- Running Java applets.
- Running Microsoft ActiveX controls.
- Displaying Flash movies.
- Displaying maps.
- Virus scanning.
- Verifying a bank ID.
Attention! Almost all browsers no longer work with Java applets and plugins.
Web browsers no longer support ActiveX controls.
Modern browsers don’t work with Shockwave Flash, either.
HTML Object Element
All browsers are compatible with the <object> element.
Objects are embedded within HTML documents with the <object> element.
It was created to embed plugins (like Java applets, PDF readers, and Flash players) in web pages, but it can also include HTML in HTML:
The following is an example of an HTML object:
Here is an example of how to use the HTML Object tag for PDF files:
In above example, the <object> tag is used to embed a PDF file into the web page. The data attribute specifies the URL of the file, while the type attribute specifies the MIME type of the file.
The width and height attributes specify the dimensions of the embedded content.
One of the key benefits of using the HTML Object tag is that it provides a fallback mechanism for browsers that do not support the content being embedded.
In the example above, the text “Alternative text – include a link to the PDF!” will be displayed for browsers that do not support PDF files.
The HTML Object tag can also be used to embed other types of content, such as videos, audio files and images.
Here is an example of how to use the HTML Object tag to embed an image:
You can also use png file with the object tag:
An <embed> Element
Every modern browser is compatible with the <embed> element.
An HTML document may also have an embedded object by using the <embed> element.
It has been a long time since web browsers included the <embed> element. Before HTML5, it was not part of the HTML specification.
Unlike a standard HTML element, the embed element does not have a closing tag. Additionally, it cannot contain alternate text.
Furthermore, HTML can be embedded with the <embed> element: