Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use multiple iFrames in my html page?

Tags:

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"/> 
like image 786
Yatrix Avatar asked Nov 09 '11 16:11

Yatrix


People also ask

How do I add multiple iframes in HTML?

You have to specify a </iframe> closing tag. Self-closing tags ( /> ) don't work. End tags are required. See also: MDN: iFrame.

How many iframes can a page have?

Except that there is a higher resource demand and other performance issues there is no fixed limitation for those tags on one page.

How do you put two iframes side by side?

1. Remove width="100%" from the iframes. 2. Change align="right" to align="left" on the second iframe if you want them completely side-by-side.

Can you have an iframe within an iframe?

After some research I found that you can't nest an iframe inside of an iframe in the same file. Instead what you need to do is add a reference to the child iframe as the src attribute for the parent iframe. What I did was create a main. html file and a youtube.


2 Answers

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.

like image 192
Rob W Avatar answered Sep 21 '22 17:09

Rob W


Iframe has a closing tag:

<iframe ...></iframe> 

Add em' in.

like image 30
Blender Avatar answered Sep 22 '22 17:09

Blender