strange behaviour of IFRAME under XHTML_Transitional in IE

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all.
I have a strange thing happening when using iframe.
Here is my small page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     " ">
<html lang="en">
    <meta http-equiv="content-type" content="text/html;
      <iframe src=" " height="100%">Your browser does
not support frames</iframe>

The way it is written, the iframe is not shown in IE browser.
It IS shown in Netscape.
If I remove from the file EITHER the doctype declaration OR the height
attribute of the frame OR the table including the iframe (leaving
iframe the only content of body), the iframe starts to show up on IE.
I also checked this page with W3C HTMLValidator, and it is valid XHTML

So I am really confused and don't understand what's wrong here.

I will be really happy to get any input on this.

Thank you all very much for help.


Re: strange behaviour of IFRAME under XHTML_Transitional in IE

Anna wrote:
Quoted text here. Click to load it

I confirm your findings. Somehow it seems the table is parsed and
rendered before the iframe actually loads the document. The 100% is
related to basically nothing.
The browsers will resort to different parsing logics when dealing with
documents triggering standards compliant rendering mode. This is the
case here too. It appears that in backward compatible mode, iframe have
a default width:300px and height:100px declaration (or so).
Whatever the explanation is, an iframe can never be considered as
tabular data; therefore, embedding an iframe in a table cell element
should not be used.

Consider that
<p style="border:2px solid red;"><iframe src=" "
height="1%">[Your user agent does not support iframes or is currently
configured not to display iframes. If you're using Opera 6+, you can
enable iframe with File/Preferences...Alt+P/Page style/Enable inline
will create in MSIE 6 SP1 a paragraph using 100% of the available height
of the viewport (not the body element excluding margins as it should
be). Best is to stay away from %tage values for height for iframes.
Mozilla 1.6 final won't render that correctly but Opera 7.50 PR1 will
render the 1% height correctly though.

If you desperately need your iframe to use a %tage of the browser window
viewport, then there would be a way to do that with javascript.


Re: strange behaviour of IFRAME under XHTML_Transitional in IE

DU wrote:

Quoted text here. Click to load it

 <caption>Cool Sites</caption>
   <th>Website Name</th>
   <td>Categorised directory of web sites.</td>
   <td><iframe src=" /">Follow the link
   <td><a href=" /"> /</a></td>

Toby A Inkster BSc (Hons) ARCS
Contact Me -

Site Timeline