所以我决定将我的 CSS 分解成一个 ie6-and-ie7-only 文件。我将在此文件中包含仅针对 ie6 和 ie7 的 CSS 规则,例如:
div {
*color: red; /* target ie7 and below */
_color: green; /* target ie6 and below */
}
如果可能的话,我更喜欢使用 PHP with$_SERVER['HTTP_USER_AGENT']
来检测浏览器,而不是使用条件注释。
我知道访问者可以“欺骗”他们的用户代理并声称是他们想要的任何浏览器,但是对于使用 PHP 而不是条件注释来检测浏览器的一般意见是什么?