SHARE
Facebook X Pinterest WhatsApp

Working with the embed markup element in your HTML5 web pages

Written By
thumbnail Vipul Patel
Vipul Patel
Nov 1, 2013

10/31/13

Introduction

HTML5 introduced lots of new markup elements. One of the new markup elements is the “embed” element. The embed element is one of the elements which is used to embed content in a web page and is used wherever external embedded content is expected.

 

The HTML5 specification says…

The HTML5 specification (http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#the-embed-element ) describes the interface for the embed markup element as follows:

IDLinterface HTMLEmbedElement : HTMLElement {

attribute DOMString src;

attribute DOMString type;

attribute DOMString width;

attribute DOMString height;

legacycaller any (any… arguments);

};

 

  • The content to be embedded is specified via the src attribute of the embed markup element.

  • The itemprop attribute cannot be specified unless the src attribute is also specified.

  • The type attribute is used to indicate the Mime type of the plugin which needs to be instantiated.

  • There is no fallback content (no alt attribute) on the embed markup element.

     

 Hands-On

Let us build a simple web page which embed a shockwave file. HTML5 recognized swf as one of the registered plugins and when the page is opened in a browser, the Shockwave content is displayed in the browser.

<!DOCTYPE html>

<html>

<meta charset=”utf-8″>

<title>Embed sample</title>

<body>

<header>

<h1>Embed markup element sample</h1>

<p>Demo showing embed markup element</p>

</header>

<embed src=”ClearExternalNoVol.swf”>

<footer>

<p>HTML Goodies</p>

</footer>

 

</body>

</html>

 

To help the readers, a sample Shockwave file and the source code of the above listing is available for download at here.

 

Summary

In this article, we learned about the embed markup element. I hope you have found this useful.

About the author

Vipul Patel is a Program Manager currently working at Amazon Corporation. He has formerly worked at Microsoft in the Lync team and in the .NET team (in the Base Class libraries and the Debugging and Profiling team). He can be reached at vipul.patel@hotmail.com

 

 

 

Recommended for you...

Best VR Game Development Platforms
Enrique Corrales
Jul 21, 2022
Best Online Courses to Learn HTML
Ronnie Payne
Jul 7, 2022
Working with HTML Images
Octavia Anghel
Jun 30, 2022
Web 3.0 and the Future Of Web Development
Rob Gravelle
Jun 23, 2022
HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.