user16240458
user16240458

Reputation:

What is the purpose of html that goes within iframe tags?

I read once somewhere that it was fallback content but it does not display when src fails to load.

<html>
<head>
</head>

<body >
    <iframe src="https://www.google.com/">
        <p>text</p>
    </iframe>

</body>

</html>

Upvotes: 1

Views: 227

Answers (1)

Quentin
Quentin

Reputation: 943142

In the current specification the content model of an iframe is defined as "Nothing" so it is an error.

The previous specification (from the '90s) said:

The contents of the IFRAME element, on the other hand, should only be displayed by user agents that do not support frames or are configured not to display frames.

So it was a fallback, but for browsers that don't support the element, not for when the URL fails to load.

Upvotes: 3

Related Questions