DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Conditional Comment

01.10.2007
| 2779 views |
  • submit to reddit
        From the microsoft website. Better than browser sniffing, the content within the tags will be shown if the condition within [] is met, in the this case IE, but you could also use IE 7 for example
  <!--[if IE]>
    Content
  <![endif]-->

  <!--[if lt IE6]> //lower than IE6
    Content
  <![endif]-->


and the XSL version

  <xsl:comment>[if IE 7]>
    Content <![endif]</xsl:comment>