Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how many iframe tags i could have in one page?

Tags:

html

browser

css

Is it possible to have two or more iframes ?

I put two empty "iframe" tags with display:none style.

But i can see only one.

if i'm commenting one in source code, then i can see another one...

<iframe id="ab" style="display: none;" />
<iframe id="cd" style="display: none;" />

and in inspector (chrome) i can see only one ;(

btw, they are both direct body childs.

like image 833
user1016265 Avatar asked Nov 04 '22 07:11

user1016265


1 Answers

Instead of using the “self-closing” syntax (/ before the >), use end tags for the iframe elements, i.e. </iframe>.

Markup like <iframe id="ab" style="display: none;" /> is in principle conforming in XML, hence in XHTML, and gets interpreted properly by modern browsers when in XHTML mode (for documents served as XHTML). In HTML mode, they see the “self-closing” tags just as start tags, so the result is a mess (and it’s even surprising that anything gets displayed).

like image 72
Jukka K. Korpela Avatar answered Nov 09 '22 08:11

Jukka K. Korpela