Search code examples
cssinternet-explorer-9framesquirks-mode

Not all CSS styles applied when page opened in IE 9 in a frame, which puts it into Quirks mode


If a web page is loaded in a frame, not all of its styles are applied. It uses the following stylesheet for the div elements:

div.super{
    position:absolute;
    font-family: Helvetica;
    font-size: 0.75em;
    padding:4px;
    overflow:auto;
    width:280px;
    min-height:110px;
    background:rgb(219, 142, 83);
    box-shadow: 10px 10px 5px rgb(150, 142, 155);
    border:2px solid rgb(219, 142, 83);
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
}

applied as

<link href="/Styles/hart_divs.css" type="text/css" rel="stylesheet" />

My target browser is IE 9 (a corporate policy standard) and it applies everything, but box-shadow and border-radius. When the same page is opened in a new window, everything is applied. FF applies everything inside a frame.

Is there any way to force IE9 to apply shadow and rounded corners inside a frame too?

Oh, and my doc type is:

<!DOCTYPE html>

EDIT: It seems that something in the frameset is putting IE9 into Quircks (Page Default) Document mode. When switching into IE9 mode, stylesheet is applied in its entirety.

The top-level frameset document was missing a document type, which I added. Now instead of going into Quirks mode by default, it goes into IE7 mode, even though I tried adding

<meta http-equiv="X-UA-Compatible" content="IE=9" />

to each and every page that may be involved: the top level frameset, navigation frame that loads my frame etc. My document has always had that meta tag.

So after investigating all that, the question is rather, how to force IE9 out of IE7 mode?

This http://msdn.microsoft.com/en-us/library/ff405803%28v=vs.85%29.aspx is not helpful.


Solution

  • The only thing that worked thus far was going into the menu, Tools/Compatibility View Settings and un-cheking Display Intranet sites in Compatibility View checkbox.

    Still looking for a programmatic solution, as this is nothing but a per-user workaround.