HTML5 <iframe> example, How to use <iframe> tag of html5.


 

HTML5 <iframe> example, How to use <iframe> tag of html5.

In this tutorial, you will see the use of <iframe> tag in HTML5.

In this tutorial, you will see the use of <iframe> tag in HTML5.

HTML5 iframe example, How to use <iframe> tag of html5.

In this tutorial, you will see the use and implementation of iframe tag. It is use for creating a inline frame. Inline frame allows you to open new document inside the main browser's window. Inline frame is also called floating frame. Iframe can be placed anywhere inside the site.

Attribute of iframe:
Attribute of form tag provides significant information about the form for the browser. There are following attributes..
  • src--URL of document which will be show in iframe.
  • srcdoc--Gives the content of nested browsing context
  • name-- specify the name of ifrme.
  • sendbox-- Set restrictions on content hosted by iframe
  • seamless--Specify that the iframe element's browsing context is to be rendered in a manner.
  • height -- specify height of iframe.
  • width--specify width of iframe.

Declaration Syntax :

Declaration syntax of iframe in HTML5.

                         <iframe src="URL">....</iframe>

Example of <iframe> in HTML5:

Code:
iframeTag.html
<!DOCTYPE html >
<html >
<head>
<title>Title of document</title>
</head>
<body>
<p><strong>iframe</strong><b> tag Example.</b></p>
<p><b>Implementation of &lt;iframe&gt; in HTML5.</b></p>
<iframe src="http://www.roseindia.net/" name="Bharat" >
</iframe><br>
<iframe src="http://www.google.co.in/" ></iframe>
<br>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The form tag is available in both HTML5 and HTML4.01. But there is some attribute in HTML5, that is not supported by HTML4.01.

Ads