The Blog of Ryan McNair

CSS - Hacks and Tricks (IE6)

Posted: April 8th, 2009 | Author: Ryan | Filed under: CSS | Tags: , , | No Comments »

Here are a few hacks and filters that can help IE6 render your webpage.

1. Conditional comment hack/filter

<!--[if IE6]>

/*insert style declarations (these will only be seen by microsoft IE6 browser)*/

width:200px;

<![endif]-->

2. Tan hack

*html .boxModel {

width: 230px;

width: 200px;

height: 130px;

height: 100px;

}

The backslash within the height and width is not readable by IE5 using Windows, but does affect IE5 for Mac and IE6 for Windows.

The differences in the two hack filters are more noticeable, the conditional comment filter can support more style declarations than the tan hack. However with both filters they are not valid CSS. The conditional comment can be used in-line and doesn’t invalidate the majority of CSS created.