Iframes in HTML:
Iframes in HTML:
Iframe is generally used to display one webpage into another webpage. With the help of Iframe, you can embed documents into the current HTML doc. Here <iframe> tag is used to define the frame.
Note: It is the right type of framing if you use the title attribute in the iframe tag, with the help of this our readers will have more comfort to read the content.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>Iframe - Target for a Link</h2>
<iframe src="http://dreamzdevelopers.com/" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="http://dreamzdevelopers.com/">dreamzdeveloper</a></p>
</body>
</html>
Link in Iframe:
Iframe is involved as a target frame in the link. When the target name will be matched then only the frame will work.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>Iframe - Target for a Link</h2>
<iframe src="http://dreamzdevelopers.com/" name="iframe_b" height="300px" width="100%" title="Iframe "></iframe>
<p><a href="http://dreamzdevelopers.com/" target="iframe_b">dreamzdeveloper.com</a></p>
</body>
</html>
How to set the size of the Iframe?
To set the height and width of the frame, you need to work on the height and width attribute of the Iframe.
You can directly use the height width attribute or can be altered by style attribute.
Example:
1.
<iframe src="http://dreamzdevelopers.com/" height="200" width="300" title="Iframe "></iframe>
2.
<iframe src="http://dreamzdevelopers.com/" style="height:200px;width:300px;" title="Iframe "></iframe>
How to remove the Iframe border?
An automatic border is assigned to Iframe, but if you need to disable it, then you must set the style value to none.
Example:
1.
<iframe src="www.dreamzdevelopers.com" style="border:none;" title="Iframe "></iframe>
2.
<iframe src="www.dreamzdevelopers.com" style="border:2px solid red;" title="Iframe "></iframe>
