Question

I am using the micro clearfix hack on a website I am developing. It works fine but I have one question about it; that I was hoping someone could clear up for me.

On the above webpage, the clearfix hack contains:

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}

Obviously just adding that to my css triggers a warning because of the *. How exactly do I include the above rule to trigger hasLayout? Do I simply remove the *? Or is there a way to include an if IE 6/7 within a stylesheet itself?

I wasn't exactly clear on if I should remove the * or just paste the code as is.

Thanks in advance.

Was it helpful?

Solution

Or is there a way to include an if IE 6/7 within a stylesheet itself?

Use the IE6/7 media query:

 @media, { .cf { zoom: 1 } }

References

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top