HTML <embed> tag

The <embed> tag allows the web-browser to embed the external contents. The content might be pdf, video or audio file, plugin or documents. It also allows to embed Flash-based object which is no longer supported in modern browsers.

Type: Inline Element

Syntax of <embed> tag

<embed src="filename"/>

Supported Browsers

Tag Chrome Internet Explorer Firefox Safari Opera Mini
<embed> Yes Yes Yes Yes Yes
<embed> tag is new in HTML 5. It is an empy tag since it has no end tag.

Full code example

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<embed
  src="demo.pdf"
  type="application/pdf"
  width="300"
  height="400"
/>
</body>
</html>
Run The code »

Attributes of <embed> tag

Attribute Value Note
height pixel It specifies the displayed height of the external embedded content.
src URL It specifies the target of the external file to be embedded./td>
type media_type It specifies the media type of the external content.
width pixel It specifies the displayed height of the external embedded content.

The src attribute is compulsory while the others are optional.

More reference

Most browsers no longer support Plug-ins and Java Applets.
To show image, use <img> tag.
For displaying video and audio files, use <video> and <audio> tag.
<iframe> tag allows to display HTML file.

Default CSS property of <embed> tag
embed {
  outline: none;
  display: inline;
}