THE HTML iframe ELEMENT

The HTML iframe element is used to nest a web page into the current web page.

HOW THE IFRAME ELEMENT WORKS

The iframe element syntax is written like this:

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

The src attribute points to the url of the web page, and the title describes the webpage content.

Here is an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe</title>
</head>
<body>
    <iframe src="https://hubtolearn.com" title="Ultimate learning hub for absolute beginners"></iframe>
</body>
</html>

You can specify the height and width of the target frame.

Here is an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe</title>
</head>
<body>
    <iframe src="https://hubtolearn.com" height="200px" width="200px" title="Ultimate learning hub for absolute beginners"></iframe>
</body>
</html>

If you observe, the target frame has a border around it, which is a default programming. To remove the border, use the border style property set to noun.

Here is an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe</title>
</head>
<body>
    <iframe src="https://hubtolearn.com" height="200px" width="200px" style="border-style: none;" title="Ultimate learning hub for absolute beginners"></iframe>
</body>
</html>

The iframe element can also be used to point to another page. To do this, the name attribute value in the iframe must be the same as that of the target attribute value.

Here is an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe</title>
</head>
<body>
    <iframe src="https://hubtolearn.com" height="200px" width="200px" style="border-style: none;" title="Ultimate learning hub for absolute beginners" name="iframe"></iframe>
    <p><a href="https://hubtolearn.com" target="iframe">Hubtolearn.com</a></p>
</body>
</html>

Nowadays, it is quite rare for developers to use the HTML iframe ELEMENT as it's becoming obsolete,but still usable.

For More Blogs about HTML visit