Summary -

In this topic, we described about the &<embed> tag along with detailed example.

The <embed> tag is new in HTML5. Embedding an external application or content into the current HTML documents. The <embed> tag is used to insert an external application or content into an HTML document.

The tag can be specified like <embed src="" type=""> with the URL of the embedded resource added to the src attribute. Most of the browsers have supported the <embed> tag for a long time. <embed> tag has no content and therefore does not warrant a closing tag.

Syntax -

<embed>.. text here.. </embed>

Below media types can be used inside embed tag.

  • .swf files - Macromedia's Flash program.
  • Avi files - Audio Video Interleaved
  • .wmv files - Microsoft's Window's Media Video file types.
  • .mov files - Apple's Quick Time Movie format.
  • .mpeg files - Moving Pictures Expert Group.

Optional Attributes -

AttributeDescriptionValues
heightSpecifies the height of the plug-in. Number in pixels.
srcSpecifies the embedded resource location.URL
typeSpecifies the linked resource typetype
widthSpecifies the width of the plug-in. Number in pixels

Example -

<!DOCTYPE html>
<html>
	<head>
		<title>Embed tag example.. </title>
	</head>
	<body>
		<embed src="img/header-logo.png" height="120px" weight="300px">
	</body>
</html>

Output -