HTML Iframes

An HTML iframe is used to display a web page within a web page.

Syntax:

<iframe src="url" title="description" > </iframe>

Set Height and Width.

Code

 <!DOCTYPE html>
<html>
<head>
<title>HTML Tutorials</title>
<style>
  
</style>

</head>
<body>
<iframe src="html_form.html" height="200" width="300" title="Registration Form"></iframe>
</body>
</html> 

Output



By default, an iframe has a border around it.

To remove the border, add the style attribute and use the CSS border property:

<body>
<iframe src="html_form.html" style="border:none;"  title="Registration Form"></iframe>
</body>


With CSS, you can also change the size, style and color of the iframe's border:

<body>
<iframe src="html_form.html" style="border:2px solid red;"  title="Registration Form"></iframe>
</body>





No comments:

Post a Comment