tags:

views:

22

answers:

2

If I put a simple iframe within a DIV any DIV's below it do not show up, the page stops there. If I just type some text with no iframe, it works fine—so it is the adding of the iframe that causes it.

The file loaded by the iframe is dummied right down and just displays the word TEST.

Before I start posting a lot of code and stuff, is this generally an issue—can an iframe be used within a DIV statement?

Thanks

A: 

There's no reason you can't wrap an Iframe in a DIV, but Iframes are notoriously difficult in layout and obviously we don't know what other styling rules might be affecting your box model.

You might try giving the containing DIV an 'overflow:scroll' or even just 'overflow:auto' in your CSS. This can help fix strange box model issues.

Superstringcheese
+2  A: 

Sounds like you're making a pretty common coding error: you can't short-tag an iframe. For instance:

<iframe src=" ... " />

is invalid. You must provide a full closing element:

<iframe src=" ... "></iframe>

It's silly, but it can cause your page to completely gum up. Also, check to make sure your quotes/apostrophes/carets are all proper, as those can cause similar problems.

Hope this helps!

mattbasta
That didn't even occur to me, but I've made that same mistake myself. First step: make sure the thing is plugged in.
Superstringcheese
Yea, I just figured that out. Thanks. Shouldn't program with my eyes closed - sometimes you just miss the obvious.
Beauford