0% found this document useful (0 votes)
21 views

4-HTML Iframes and Link

Uploaded by

Charan Chowdary
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

4-HTML Iframes and Link

Uploaded by

Charan Chowdary
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

HTML IFrames

iframe
• The iframe tag in HTML stands for Inline Frame and is used to embed another
HTML document within the current document. It supports various attributes
for specifying dimensions, borders, scrolling, and more to customize the
appearance and behavior of the embedded content.

• It requires an src attribute specifying the URL of the document to be


embedded. Also enables the inclusion of videos, maps, or entire web pages
from other sources.

Syntax:
<iframe src="URL" title="description"></iframe>
Attributes value:
It contains a single value URL that specifies the URL of the document
that is embedded in the iframe. There are two types of URL links which
are listed below:

URL

Absolute URL - It points to another webpage.

Relative URL - It points to other files of the same web page.


Example
<!DOCTYPE html>
<html>
<head>
<title>HTML iframe Tag</title>
</head>
<body style="text-align: center">
<h1>SouthAsaianConference</h1>
<h2>HTML iframe Tag</h2>
<iframe src="https://sarc.net.in/Tentativeprogramme.php"
height="200"
width="400">
</iframe>
</body>
</html>
Output
Height and Width:

The height and width attributes are used to specify the size of the
iframe. The attribute values are specified in pixels by default, but they
can also be specified in percentages like ” 80% “.
<!DOCTYPE html>
<html>

<body>
<h1>Conference</h1>
<h2>HTML iframe Tag</h2>

<p>
Content goes here
</p>

<iframe src="https://sarc.net.in/Tentativeprogramme.php"
height="300"
width="400">
</iframe>
</body>

</html>
Border
style="border: 4px solid orange“
Link
An iframe can be used as the target frame for a link. The target
attribute of the link must refer to the name attribute of the iframe.
Example
<!DOCTYPE html>

<html>

<body>

<h1>Conference</h1>

<h2>HTML iframe Tag</h2>

<p>

Click the link text

</p>

<iframe src= "https://media.geeksforgeeks.org/wp-content\uploads/20210910170539/gfg-221x300.png"

height="300"

width="350"

name="iframe_a">

</iframe>

<p>

<a href="https://sarc.net.in/Tentativeprogramme.php"

target="iframe_a">

GeeksforGeeks IDE

</a>

</p>

</body>

</html>

You might also like