www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Compatibility in Internet Explorer 5.5

This document describes the features in Microsoft Internet Explorer 5.5 that may not be compatible with applications you developed for earlier versions of Windows Internet Explorer.

This document assumes that you are familiar with Dynamic HTML (DHTML) and Cascading Style Sheets (CSS).

The following topics are discussed in this document.

Stricter CSS Parsing

CSS parsing is stricter in Internet Explorer 5.5 and later. Stricter parsing is more consistent with the standards promulgated by the World Wide Web Consortium (W3C)—the CSS, Level 1 (CSS1) and CSS, Level 2 (CSS2) specifications. Because of this stricter CSS parsing, Internet Explorer 5.5 and later handle invalid tokens and unmatched quotation marks in style rules differently than earlier versions of Internet Explorer.

Tokenization

As of Internet Explorer 5.5, if a selector contains an invalid token, or character, the entire style rule is ignored. This behavior conforms with CSS 2. Earlier versions of Internet Explorer apply style declarations to the valid portion of a selector.

Consider the following style rule, for example:

    <STYLE>
        H1, H2 & H3 { color: red }
    </STYLE>

Internet Explorer 5.5 and later ignore the preceding style rule because the ampersand (&) is not valid in a CSS 2 selector. Earlier versions of Internet Explorer ignore only the portion of the selector that precedes the invalid token ("H1, H2") and apply the declaration to the portion of the selector that follows the invalid token. With earlier versions of Internet Explorer, H3 elements render red in documents with this style rule, while none of the hn elements renders red with Internet Explorer 5.5 and later.

If selectors in your applications contain invalid tokens, the style rules are ignored by Internet Explorer 5.5 and later. To achieve the effect you want, you must delete invalid tokens from your style sheets.

Quotation Marks

As of Internet Explorer 5.5, quotation marks in a declaration must occur in matched pairs, or the entire style rule is ignored. This applies to single quotation marks (') and double quotation marks ("). This behavior also conforms with CSS 2. Earlier versions of Internet Explorer 5.5 permit unmatched quotation marks in some declarations.

Consider the following style rule, for example:

    <STYLE>
        H1 { "color: red }
    </STYLE>

Notice that there are double quotation marks preceding the color property in the declaration and no quotation marks at the end of the declaration. Internet Explorer 5.5 and later ignore this style rule. Earlier versions of Internet Explorer ignore the unmatched quotation marks and apply the rest of the declaration to the H1 selector, which causes H1 elements in documents with this style rule to render red.

If your applications contain declarations with unmatched quotation marks, the style rules are ignored by Internet Explorer 5.5 and later. To achieve the effect you want, delete the quotation marks.

Quotation marks are not necessary in embedded or external style rules anyway and are not permitted around property names. The following style rules are illegal and are properly ignored by Internet Explorer 5.5 and earlier versions of Internet Explorer.

    <STYLE>
        H1 { "color": red }
        H2 { "color:" red }
        H3 { "color: red" }
    </STYLE>

Borders, Margins, and Padding on Inline Elements

As of Internet Explorer 5.5, border, margin, and padding attributes are supported on inline elements, such as the span element. This behavior conforms with CSS 1. Inline elements do not support these attributes in earlier versions of Internet Explorer.

If applications you developed for earlier versions of Internet Explorer contain style rules that set or retrieve border, margin, or padding attributes on inline elements, the style rules have no effect with these versions. If you want the same effect with Internet Explorer 5.5 and later, delete these style rules.

Windowless IFRAME Elements

The iframe element is windowless with Internet Explorer 5.5 and later. This significantly improves the performance of applications that use these elements. Windowless iframe elements can properly support the zIndex attribute and the transparent value of the backgroundColor attribute. In earlier versions of Internet Explorer, the iframe element is windowed—essentially an embedded copy of the browser itself.

The following sections describe how the zIndex and display attributes work differently on iframe elements with Internet Explorer 5.5 and later than with earlier versions of Internet Explorer.

zIndex

Because they are windowless, iframe elements support the zIndex attribute in Internet Explorer 5.5 and later. Windowed controls, such as select elements, ignore the zIndex attribute. If your applications were designed for earlier versions of Internet Explorer, you might want to redesign pages containing iframe elements that are stacked on top of windowed controls. You can use the visibility attribute to hide windowed controls that you want an iframe element to overlap. You can also position windowed controls so that iframe elements do not overlap them.

Display

When the display attribute of an iframe element is set to none, earlier versions of Internet Explorer lay out the contents of the frame anyway. Although the contents are not being displayed, this does affect the positioning coordinates exposed in the object model of that document. With Internet Explorer 5.5 and later, iframe elements are not laid out until they are displayed. This behavior is identical to other elements set to 'display: none.' You may need to modify scripts that access the position object model to achieve the same effect you had before.

Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG