How do I use multiple iFrames in my html page?

北战南征 提交于 2019-12-22 01:33:15

问题


I just have them in the body of the page one after the other. If I do this with <object>, I see them all. With iFrames, I only see the first one.

<iframe id="AlertMaintenance" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="AlertMaintenance.html"/>

<iframe id="DelayReason" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="DelayReason.html"/>

回答1:


You have to specify a </iframe> closing tag. Self-closing tags ( />) don't work.

Working code:

<iframe id="AlertMaintenance" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="AlertMaintenance.html"></iframe>
<iframe id="DelayReason" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="DelayReason.html"></iframe>

End tags are required. See also: MDN: iFrame.




回答2:


Iframe has a closing tag:

<iframe ...></iframe>

Add em' in.




回答3:


You're trying to use selfclosing tags.

Change this to:

<iframe id="AlertMaintenance" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="AlertMaintenance.html"></iframe>

<iframe id="DelayReason" style="border-style: none; border-color: inherit; border-width: 0px; height:1222px; width:100%;" src="DelayReason.html"></iframe>


来源:https://stackoverflow.com/questions/8068578/how-do-i-use-multiple-iframes-in-my-html-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!