HTML5 iframe Element

HTML5 iframe Element with Example: HTML 5 specifications refer to the iframe <iframe> element as a nested browsing context. In simple words, it helps you to pick the content from another source or web page and embed it on your own web page without the help of another document. You simply have to use an src attribute to define the location of the content you want to embed.

The following example explains how to add an inline frame using iframes.

The iframe Element Example

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Using iframe Element</title>
</head>
<body>
<h1>How to use iframe element in HTML 5</h1>
<p>iframe element helps you to embed content from another source</p>
<iframe src="https://tutorials.freshersnow.com" width="300" height="300"</iframe>
</body>
</html>

You can use iframes to embed almost anything you like, such as videos. Similarly, you can also use the iframe element as target frames for links.