iframe in HTML
- iframes are used to embed different pages on the current web page.
- Mainly used to embed videos and advertisements on a single web page.
- iframes are created using <iframe> tag.
Syntax:
<iframe src="URL" title="description" frameborder="0"></iframe>
Attributes:
i). src: Specify the URL of the web page that you want to embed.
ii). title: It is used to describe the contents of the frame.
iii). frameborder: It is used to draw a border around the frame.
iv). height: It is used to set the height of the iframe.
v). width: It is used to set the width of the iframe.
vi). style: The style attribute is used to add custom style to the iframe.
Let's see an example of HTML iframes:
iframe in HTML example
<iframe src="https://www.geekshelp.org"
title="Website for web developers and computer science students"
frameborder="1"
height="300px"
width="400px"
style="border: 5px solid purple;">
</iframe>