Reputation: 44352
Why if an iframe is closed on its opening tag (short hand) does it stop rendering the page:
Stops rendering
<iframe src=""/>
<p>my text</p>
vs.
Works fine
<iframe src=""></iframe>
<p>my text</p>
Upvotes: 0
Views: 872
Reputation: 324740
Because the <iframe>
tag cannot be self-closing, any more than a <script>
tag can.
Upvotes: 2
Reputation: 943936
HTML is not XHTML (and XHTML served as text/html isn't either). You cannot close arbitrary elements by ending their start tag with a /
character.
The paragraph is considered to be inside the iframe (and thus is alternative content for browsers that don't support iframes) because you have not provided an end tag for it.
You may find it useful to perform some basic QA with a markup validator.
Upvotes: 2