Css ExplorerHack
Der Internet Explorer für Apple Macintosh hat im Gegensatz zu den Windows-Versionen das korrekte Box-Modell implementiert. Während Opera 6 das korrekte Modell benutzt, verhält sich Opera ab Version 7 nur im Standards Mode richtig und imitiert damit das Verhalten des Internet Explorers 6 für Windows.
Workshop: Browserweiche * Der Netscape 4 * Browserweiche für Netscape 4 * Netscape 4 sperren * Der Internet Explorer 5 * Browserweiche für Internet Explorer mit Javascript * Browserweiche für Internet Explorer mit Conditional Comments * Attributabhängige Selektoren als Browserweiche
http://barrierefrei.e-workers.de/workshops/ie-fun/index.html
* Spans for line-anchors - uses * html hack so that the rule only applies to
* IE (where omitting the "display: none" triggers rendering bugs).
*/
* html span.anchor { display: none; }
/* IE6 has a bug with rendering of float elements. We workaround this bug by
* assigning those elements a height attribute because we currently don't know
* a better solution. This results in IE calculating the correct height of the
* characters and displaying them correctly. We don't know any negative side
* effects of this workaround:
*/
* html div#page, * html div#header { height: 0.001%; }
div {
width: 100px;
padding: 10px;
border: 5px solid black;
margin: 10px;
}
/* A CSS comment before the hack \*/
* html div {
width: 130px;
}
/* Another CSS comment after the hack */
Look at the top comment. See that escape just before the closing tag? Because of that escape, IE5/mac fails to recognize the closing tag, and so fails to read the entire Tan hack. The second comment below the hack provides a closing tag for IE5/mac's benefit. In this way, IE5/mac reads only the value in the normal code block before the hack. This Mac hack, called the Commented Backslash hack, was discovered by Sam Foster. Version 2, the one we're using here, was suggested by James Craig.
Tags: css | webdesign | style | tutorial | reference | html | web | design |
Internet/html/css/ExplorerHack (last edited 2009-11-21 23:25:13 by DetlevLengsfeld)