How do I use multiple iFrames in my html page?

2019-04-18 13:23发布

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"/>

标签: html iframe
3条回答
We Are One
2楼-- · 2019-04-18 13:36

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.

查看更多
手持菜刀,她持情操
3楼-- · 2019-04-18 13:54

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>
查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-04-18 13:57

Iframe has a closing tag:

<iframe ...></iframe>

Add em' in.

查看更多
登录 后发表回答