HTML Iframe
- A html iframe another way to say "Inline" is a HTML component that permits you to embed another html archive or page inside the ongoing page.
- It makes a rectangular "edge" or window inside your site page , and the substance of the iframe is commonly shown inside that casings.
- The 'src' attribute specifies the URL of the web page you want to embed within the iframe.
- The content of the specified URL will be loaded and displayed within the iframe on your web page.
- You can control various aspects of the frame's behavior and appearance by using attributes such as 'width' , 'height' , 'frameborder' , etc...
Syntax:
An HTML iframe is defined with the <iframe> tags:
<iframe src="URL"> </iframe>
<iframe src="URL"> </iframe>
Example 1:
<!DOCTYPE html>
<head>
<title>HTML Iframe</title>
</head>
<body>
<h1>Visit the GOCOURSE website<h1>
<iframe src="https://www.gocourse.in" width="600" height="400" frameborder="0">
<title>HTML Iframe</title>
</head>
<body>
<h1>Visit the GOCOURSE website<h1>
<iframe src="https://www.gocourse.in" width="600" height="400" frameborder="0">
</iframe>
</body>
</html>
</body>
</html>
Output:
Example 2:
<!DOCTYPE
html>
<head>
<title>HTML
Iframe</title>
</head>
<body>
<iframe
name="iframe_a"
height="400px"
width="50%"></iframe>
<p><a
href="https://www.gocourse.in" target="iframe_a">gocourse.in</a></p>
<h1>GOCOURSE
website<h1>
</body>
</html>
Output:
Uses Of Html Iframes:
- Embed external content
- Content isolation
- Cross-domain integration
- Google maps
- You tube vedios (can embed)
More topic in HTML