HTML iframe tag
The iframe HTML element is used to display a web page within a web page
1
. It is also called an inline frame. An iframe can be used to embed another document, such as a video, a map, or another web page, into the current HTML document
2
.
Here is an example of creating an iframe with a URL address that goes to https://www.w3schools.com:
<iframe src="https://www.w3schools.com" title="W3Schools website" height="500" width="500"></iframe>
The iframe element has the following attributes:
src: Defines the URL of the page to embed
1
.
title: Defines a title for the iframe. This is used by screen readers to read out what the content of the iframe is
1
.
height: Defines the height of the iframe in pixels or percentage
1
.
width: Defines the width of the iframe in pixels or percentage
1
.