Jon
Jon

Reputation: 2584

Multiple iFrames, only the first one loads

I have multiple iFrames:

<html>
<head>
<title>Page</title>
</head>
<body>
<iframe src="http://website1.com" /><p></p>
<iframe src="http://website2.com" /><p></p>
<iframe src="http://website3.com" /></p>
<iframe src="http://website4.com" /><p></p>
</body>
</html>

However, website1.com loads as an iframe. If I put website2 above it, only website2 loads. How do I make all 4 iframes load? It's not hidden, I used inspect element to verify that ONLY website1 is displayed.

Upvotes: 0

Views: 1386

Answers (1)

MrMike
MrMike

Reputation: 1540

Your problem is that iFrames are not self-closing tags. Make your iFrame tags using this syntax instead:

<iframe src="http://google.com"></iframe><p></p>
<iframe src="http://yahoo.com"></iframe><p></p>
<iframe src="http://ask.com"></iframe><p></p>
<iframe src="http://bing.com"></iframe><p></p>

JSFiddle: http://jsfiddle.net/7q6BC/

Upvotes: 1

Related Questions