Frage

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]-->
War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top