문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top