142) in Internet Explorer 5.x
and other standards-compliant browsers. It??™s also known as the Tantek Hack??”named
after its inventor, Tantek ?‡elik.12 It??™s an ugly and complicated hack that??™s virtually
12 http://tantek.com/CSS/Examples/boxmodelhack.html
The Ultimate CSS Reference 406
impossible to remember off the top of your head. Here??™s what the complete hack
looks like:
.test {
width: 500px;
padding: 50px;
voice-family: "\"}\"";
voice-family: inherit;
width: 400px;
}
html>body .test{
width: 400px;
}
The hack worked thanks to a flaw in the CSS parser in Internet Explorer 5.x, and it
effectively cut the declaration block short at the curly brace in the middle of this
section of code: "\"}\"".
This flaw effectively made Internet Explorer 5.x see something like this:
.test {
width: 500px;
padding: 50px;
voice-family: "\"}
The browser ignored the width: 400px; declaration, and retained the 500px width
value. Most other browsers will apply the 400px width instead.
Pages:
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590