Why Do We Create Iframe In HTML

admin_img Posted By Bajarangi soft , Posted On 29-09-2020

An HTML iframe is used to display a web page within a web pageThe HTML <iframe> tag specifies an inline frame,An inline frame is used to embed another document within the current HTML document,Use the height and width attributes to specify the size of the iframe,To remove the border, add the style attribute and use the CSS border property,The target attribute of the link must refer to the name attribute of the iframe:

HTML Iframes

1.Create iframe Inside HTML 

<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>
<p>You can also use the CSS height and width properties to specify the size of the iframe:</p>

<iframe src="demo_iframe.htm" style="height:200px;width:300px" title="Iframe Example"></iframe>

</body>
</html>
2.We Can Add Link To The Iframe in HTML File
 
<!DOCTYPE html>
<html>
<body>

<h2>Iframe - Target for a Link</h2>

<iframe src="demo_iframe.htm" name="iframe_a" height="300px" width="100px" title="Iframe Example"></iframe>

<p><a href="https://bajarangisoft.com" target="iframe_a">bajarangisoft.com</a></p>

<p>When the target attribute of a link matches the name of an iframe, the link will open in the iframe.</p>

</body>
</html>

 

Related Post