Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12574 > unrolled thread

iframe and its background color problem with IE

Started byjustaguy <lichunshen84@gmail.com>
First post2012-03-10 08:25 -0800
Last post2012-03-10 19:10 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  iframe and its background color problem with IE justaguy <lichunshen84@gmail.com> - 2012-03-10 08:25 -0800
    Re: iframe and its background color problem with IE "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-03-10 19:10 +0200

#12574 — iframe and its background color problem with IE

Fromjustaguy <lichunshen84@gmail.com>
Date2012-03-10 08:25 -0800
Subjectiframe and its background color problem with IE
Message-ID<11a7c39d-f0bb-475f-ad81-591d39b5d322@ow8g2000pbc.googlegroups.com>
Hi,

The following code would render expected results with Firefox (3.6 and
above), however, with IE 7/8/9
the background color attribute has no effect, why?  Thanks.

<iframe id="txt" ... style="border:1px solid; background-
color:#EFF9FC"></iframe>

[toc] | [next] | [standalone]


#12575

From"Jukka K. Korpela" <jkorpela@cs.tut.fi>
Date2012-03-10 19:10 +0200
Message-ID<jjg1tu$fc5$1@dont-email.me>
In reply to#12574
2012-03-10 18:25, justaguy wrote:

> The following code would render expected results with Firefox (3.6 and
> above), however, with IE 7/8/9
> the background color attribute has no effect, why?  Thanks.
>
> <iframe id="txt" ... style="border:1px solid; background-
> color:#EFF9FC"></iframe>

This is not a JavaScript question; moving discussion to a group on CSS.

The CSS settings for an iframe element are supposed to relate to the 
inline frame box that constitutes part of document where it resides, 
rather than the contents shown in the box. The contents is affected by 
its own style sheet, so set any desired background there.

However, the default background is transparent, and it is more or less 
natural to expect that then the background of the inline frame box 
shines through. Although most browsers have adopted this view, IE has 
not done so before IE 9. If you don't see the background color on IE 9, 
then the reason is that your document is displayed in Quirks Mode; try 
adding <!doctype html> at the very start of the document to see this.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web