Iframe HTML

iframe html. Used to create inline frames in the <iframe> tag. With this help, the second HTML document is embed on the current HTML document. The <iframe> tag is given inside the body of the HTML document.

Iframe Syntax

<iframe src="URL"></iframe>

Example

<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>

<iframe src="demo_iframe.html" height="200" width="300"></iframe>

</body>
</html>

Iframe – Height and Width

The width and height attribute of the <iframe> tag is given to the height of the frame and the size of the width.

Example

<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>

<iframe src="demo_iframe.html" height="200" width="300"></iframe>

</body>
</html>

you can use CSS to set the height and width of the iframe

Example

<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>

<iframe src="demo_iframe.html" style="height:200px;width:300px"></iframe>

</body>
</html>

Iframe Background color

<!DOCTYPE html>
<html>
<body>

<h2>HTML Iframes</h2>

<iframe src="demo_iframe.html" style="background-color:#000; height:200px; width:300px"></iframe>

</body>
</html>

Iframe Remove the Border

style = “border: none;” to remove the border of the frame Is use.

Example

<!DOCTYPE html>
<html>
<body>

<h2>Remove the Iframe Border</h2>

<iframe src="demo_iframe.html" style="border:none;"></iframe>

</body>
</html>