iframe element isn’t a self-closing element. The versions of Firefox and Safari you’re using are treating the
/> at the end as just
> and assuming everything after it is contained within the
If we attempt to pass the code you’ve given through W3C’s validator we’ll see the following errors:
Error: Self-closing syntax (
/>) used on a non-void HTML element. Ignoring the slash and treating as a start tag.
Error: End of file seen when expecting text or an end tag.
Error: Unclosed element
If you inspect your document with your browser’s Element Inspector, you’ll see what’s going on.
Chrome, which I’m using, converts the invalid
<iframe ... /> to