HTML Conditional Comments


/ Published in: HTML
Save to your folder(s)

HTML conditional comments used to target specific versions of Internet Explorer (is ignored by all other browsers).


Copy this code and paste it in your HTML
  1. <!-- Condtional comment: All IE Versions -->
  2. <!--[if IE]>
  3. This is Ineternet Explorer
  4. <![endif]-->
  5.  
  6.  
  7. <!-- Condtional comment: IE6 only -->
  8. <!--[if IE 6]>
  9. This is Internet Explorer 6
  10. <![endif]-->
  11.  
  12.  
  13. <!-- Condtional comment: All IE versions after 5 -->
  14. <!--[if gt IE 5]>
  15. This Internet Explorer was released after IE5
  16. <![endif]-->
  17.  
  18.  
  19. <!-- Condtional comment: All IE versions before 8 -->
  20. <!--[if lt IE 5]>
  21. This Internet Explorer was released before IE8
  22. <![endif]-->

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.