Hide Comments

Hide Comments

[Login to edit this page]

This hack exploits a bug in Internet Explorer for Mac related to comment parsing. A comment ending in \*/ is not properly closed in IE Mac, so rules that need to be ignored in IE Mac can be placed after such a comment. Another comment is needed after the rule to close the comment for IE Mac.

Called the "box model hack" because the bug it is most often used to work around is the Internet Explorer box model bug, this hack provides a different set of properties to Internet Explorer and other browsers. As of version 6, IE has corrected the box model bug in documents which include certain Document Type Declarations (required by the HTML specifications) in certain ways.

The first voice-family statement is set to the string "}", but an IE parser bug will interpret it as a string with a single backslash followed by a closing brace for the end of the rule. voice-family is chosen because it will not affect rendering on a screen style sheet. The second rule uses the html>body hack for browsers such as Opera 5 that have the parsing bug but do not have the box model bug (and, additionally, which support the child selector).

Versions 6 and below of Internet Explorer recognize properties with this prefix (after discarding the prefix). All other browsers ignore such properties as invalid. Therefore, a property that is preceded by an underscore or a hyphen is applied exclusively in Internet Explorer 6 and below.

This hack uses invalid CSS, relies on a "bug" in the browser, and there are valid CSS directives to accomplish the same thing, so this hack is not recommended.

Versions 7 and below of Internet Explorer recognize properties which are preceded by non-alphanumeric characters except an underscore or a hyphen (after discarding the prefix). All other browsers ignore such properties as invalid. Therefore, a property that is preceded by an non-alphanumeric character other than an underscore or a hyphen, such as an asterisk or star, is applied exclusively in Internet Explorer 7 and below.

This hack uses invalid CSS, relies on a "bug" in the browser, and there are valid CSS directives to accomplish the same thing, so this hack is not recommended.

The html element is the root element of the W3C standard DOM, but Internet Explorer versions 4 through 6 include a mysterious parent element. Fully-compliant browsers will ignore the * html selector, while IE4-6 will process it normally. This enables rules to be specified for these versions of Internet Explorer which will be ignored by all other browsers. For example, this rule specifies text size in Internet Explorer 4-6, but not in any other browsers.

This hack uses fully valid CSS.

Although Internet Explorer 7 no longer recognizes the classic star HTML hack, it has introduced a similar hack using selectors new to IE7:


0 Comments

Write a comment

Rating:    

Share On Facebook
Search And Find
Epik Search:

Related Clips for Hide Comments

Join The Epik Network
Join Now:

Browse The Epik Network

  • Judibowker

    Nina-gordon

    Theopiumwar

    Menswear

    Doncheadle

    Greekparody

    Karahui

    Manejar

    Easy-jet

    Echtpaar

    Niencheng

    Satadvd

    Hualalai

    Haventfound

    Marcusking

    Kidman

    Annewaldman

    Katiedownes

    Selenali

    Luanpeters

    Pantsing