문제

Am I doing something incorrect here? I have !ie conditionals, however it seems that Safari 6 (not below) is not calculating these anymore. Has anyone experienced this?

my block:

<!--[if !IE]>
<style type="text/css">
  /* styles */
</style>
<![endif]-->
도움이 되었습니까?

해결책

You need to enclose the conditional statements in their own comments using this syntax:

<!--[if !IE]><!-->
<style type="text/css">
  /* styles */
</style>
<!--<![endif]-->

Otherwise the whole thing will be treated as one giant comment block, and that should happen in any version of Safari, not just 6. See this question and its answers for details.

다른 팁

Per MSDN the IE conditional for !IE is:

<![if IE]>

It's not a comment at all because anything inside a comment is going to be hidden by a standards compliant browser.

Please do the world a favor and only use conditional comments for IE. At least it's technically standards compliant as the non-standard code is inside of a comment. The fake tag above would not validate.

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