Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dynamic width of iframe in DIV

0 views
Skip to first unread message

Hans Gommers

unread,
May 3, 2002, 4:43:27 AM5/3/02
to
Hi,

I have an IFRAME inside a DIV. I would like the iframe to be almost the same
size as the div. So if the div is 100x100 i try to get the iframe to be
92x92 and in the center. If possible I would like to do this is in
stylesheets.

For example: Can I put something at the questionmark below to make it work?
I tried with expressions, but all I achieve is crashing internet explorer. I
rule like expression(parentNode.offsetWidth - 8) makes ie5.5 unresponsive.

<STYLE>
.container
{
width: 100%;
}
.container IFRAME
{
width: ?
}

<DIV CLASS="container">
<IFRAME></IFRAME>
</DIV>

Hans


Hans Gommers

unread,
May 3, 2002, 5:03:14 AM5/3/02
to
Doh, I found the problem myself.

I had a padding in the DIV and IE5.5 seems to ignore this during the first
rendering. When I resize the browser it suddenly works fine. Guess I'll
forget about padding :(

If you like to see the bug look at this example and resize your browser:
<DIV STYLE="padding: 4px;background-color:black">
<IFRAME STYLE="width:100%">
</IFRAME>
</DIV>

Hans

"Hans Gommers" <hans.g...@ksdnet.nl> schreef in bericht
news:#oMoZ6n8BHA.1364@tkmsftngp03...

Dante

unread,
May 20, 2002, 7:43:16 AM5/20/02
to
Change <IFRAME STYLE="width:100%"> to <IFRAME STYLE="width:99%">


"Hans Gommers" <hans.g...@ksdnet.nl> wrote in message
news:#hiWdFo8BHA.2588@tkmsftngp04...

Hans Gommers

unread,
May 21, 2002, 3:29:40 AM5/21/02
to
That doesn't solve it in all sizes. Some sizes will happen to look ok, some
don't.

I got it working with margins instead of padding, but thanks anyway.

Hans

"Dante" <geno...@msn.com> schreef in bericht
news:eyqmeO$$BHA.1828@tkmsftngp05...

0 new messages