HTML Plug-ins

Plug-ins are computer programs that extend the standard functionality of the browser.

Plug-ins

Plug-ins were designed to be used for many different purposes: .To run Java applets .To run Microsoft ActiveX controls .To display Flash movies .To display maps To scan for viruses .To verify a bank id

The <object> Element

The <object>ment is supported by all browsers. The <object> element defines an embedded object within an HTML document. It was designed to embed plug-ins (like Java applets, PDF readers, and Flash Players) in web pages, but can also be used to include HTML in HTML:

Output:

Or images if you like:

Output 2:

The <embed> Element

Output:

The <embed> element can also be used to include HTML in HTML:

Output:

Practice Exercises

Task: How to embed external HTML documents, media files, and legacy plug-in objects using the <object> and <embed> elements?

Goal: Create a page that embeds an external HTML file using <object>, embeds an image using <embed> with custom dimensions, and understands the core purpose of browser plug-ins.
💡 Hint: Use the data attribute for <object> and the src attribute for <embed>, along with width and height attributes.
💡 Show Solution
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Plug-ins & Embedding Practice</title>
  </head>
  <body>

    <h3>1. Embedded HTML Document using &lt;object&gt;</h3>
    <object data="snippet.html" width="100%" height="200px"></object>

    <h3>2. Embedded Image Content using &lt;embed&gt;</h3>
    <embed src="car1.png" width="40%" height="auto">

  </body>
</html>
Output:

1. Embedded HTML Document using <object>

This is snippet.html page

2. Embedded Image Content using <embed>

Sports Car
Explanation:
  • Plug-ins Overview: Plug-ins are browser extensions designed to perform specialized tasks such as executing Java applets, ActiveX controls, rendering PDFs, or playing Flash movies.
  • <object> Element: Container designed to hold external media, plug-ins, or HTML documents. It uses the data attribute to link the external file.
  • <embed> Element: A self-closing HTML tag used as an integration container for external resources (HTML files, images, interactive plug-ins) using the src attribute.