Articles → HTML → Conditional comments in HTML

Conditional comments in HTML






Purpose of conditional comments





Syntax


<!--[if (expression)]>HTML<![endif]-->



Predefined strings









Example




<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8" />
      <title></title>
   </head>
   <body>
      <!--[if (IE)]>       Internet Explorer <![endif]-->
      <!--[if !(IE)]><!--> Other than IE<!--<![endif]-->
   </body>
</html>



Output





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, January 15, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250