• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

HTML5 Embed Tag

March 12, 2014 //  by Krishna Srinivasan//  Leave a Comment

The Html <embed> element is used to embedding an external application or interactive content to the web page. This is a standard and well supported HTML5 tag for embedding multimedia files into the web page (note that prior to the HTML5 specification, this tag is used as the non-standard tag and supported by all the browsers. HTML5 has added to the specification.

One of the important point is that, <embed> tag will not support any of the natively supported by the browsers like HTML and Images. The purpose of this tag is to add the objects which are not supported by the browsers and requires plug-in to display like flash player.

Syntax of <embed> Tag

<embed src=" media file name"> </embed>

Browser Support

<embed> element in HTML5 is supported in almost all browsers such as Internet Explorer, Firefox, Opera, Chrome, and Safari.

Attributes of <embed> Tag

  • src : This attribute specifies the url address of the external file.
  • height : This attribute specifies the content height that to be displayed.
  • width : This attribute specifies the content width that to be displayed.
  • type : This attribute specifies MIME type of the content embedded.

HTML5 <embed> Example

<!DOCTYPE HTML>
<html>
 <head>
   <title>HTML5 embed element example</title>
 </head>
 <body>
   <embed src="embed_element.gif" width="40%" height="250" >
 </body>
</html>
  • <embed src=”embed_element.gif” width=”100%” height=”250″ > is used to insert the image by using the attribute src which specify the location of the image, width and height attribute is used to set the height of the image.

Example Application Test

  • Save the file as embed.html in your system.
  • Just open the file in the browser, you will see the below picture in the browser. Note that the browser must support HTML5 specification.

Output

When the execution process is completed successfully we will get the following output :
html5 embed

Category: HTMLTag: HTML5

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: « HTML5 DataList Tag
Next Post: JPA Entity Listeners And Callback Methods »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

EJB 3.0 Timer Services

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact