Both
of the hacks we??™ll discuss in this section constitute legal CSS, but rely on specific
browser bugs in order to work.
The first application we??™ll look at is the backslash hack, in which a backslash
character is inserted into a property name. The backslash indicates a character
escape in CSS escape notation (p. 43) and browsers that comply with the CSS
specification should ignore the character in this context. However, Internet Explorer
5.5 and earlier versions will ignore the whole declaration when they meet a character
escape in the middle of a property name. Here??™s an example:
10 http://www.dynamicsitesolutions.com/css/filters/support-chart/
11 http://centricle.com/ref/css/filters/
405 Workarounds, Filters, and Hacks
.test {
height: 500px;
he\ight: 400px;
}
Modern browsers will apply a height of 400px, but Internet Explorer 5.5 and earlier
versions will retain the value of 500px, since they??™ll ignore the latter declaration.
Positioning the Backslash
For this hack to work properly, the backslash must be positioned in the middle of
the property, not at the beginning.
Pages:
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588