HTML 5 TutorialsUsing Iframe tag in HTML

Using Iframe tag in HTML

Our blog post today is showing a simple use of Iframe tag. You can define a frame height and width and present a image, video or a website in it. In our code today we will use Iframe to show a website within the bounds of a frame. The <iframe> basically defines an inline frame.

Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>I-FRAME</title> 
//This part of the code shows the title of the page as”I-FRAME”
</head>

<body>
<h1>Example Of I-Frame</h1>
<iframe src="http://eduonix.com/blog" width="700px" height="400px" align="left">

</iframe>
//ending tag of <iframe>
</body>
</html>

Code explanation

We start by standard definition of the HTML page. The Head contains the title I-Frame. In the body we start by creating the iframe tag and in src which stands for source we place the url for eduonix. We define the width as 700 px and height as 400 px. Alignment is set to left. You can have it on center of right as well. We end the iframe tag, the body and the HTML. The output will be like the following

Output

Capture

Exclusive content

- Advertisement -

Latest article

21,501FansLike
4,106FollowersFollow
106,000SubscribersSubscribe

More article

- Advertisement -