HTML Plug-ins
Plug-ins are computer programs that extend the standard functionality of the browser.
Plug-ins
Plug-ins were designed for many purposes, such as running Java applets, running Microsoft ActiveX controls, displaying Flash movies, showing maps, scanning for viruses, and verifying a bank id.
Warning !
Most browsers no longer support Java applets and plug-ins. ActiveX controls are no longer supported in any browser, and support for Shockwave Flash has also been turned off in modern browsers.
The <object> Element
The <object> element is supported by all browsers and defines an embedded object in a document. It was designed to embed plug-ins like Java applets, PDF readers, and Flash players, but it can also be used to include one HTML file inside another, or to show an image.
Embed HTML
Embedding another HTML file with <object>.
Output: complete HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Object Html</title>
</head>
<body>
<object width="100%" height="500px" data="snippet.html"></object>
</body>
</html>
Embed an image
Showing an image with <object>.
Output: complete HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Object Image</title>
</head>
<body>
<object data="audi.jpeg"></object>
</body>
</html>
The <embed> Element
The <embed> element is supported in all major browsers and also defines an embedded object. Browsers have supported it for a long time, though it only became part of the HTML specification in HTML5. It can show an image or include one HTML file inside another.
Note: The <embed> element has no closing tag and cannot contain alternative text.
Embed an image
Showing an image with <embed>.
Output: complete HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Embed Image</title>
</head>
<body>
<embed src="audi.jpeg">
</body>
</html>
Embed HTML
Embedding another HTML file with <embed>.
Output: complete HTML page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Embed Html</title>
</head>
<body>
<embed width="100%" height="500px" src="snippet.html">
</body>
</html>