How to create conditional comments in HTML?

Front End ScriptsHTMLWeb DevelopmentFront End Technology

Conditional comments in HTML target Internet Explorer. They define some tags, which get executed by Microsoft Internet Explorer. It adds additional syntax to comments and supported from Explorer 5 onwards.

Browsers aren’t aware of the conditional comments will consider this as any other comment.


You can try to run the following code to learn how to add conditional comments in HTML

Live Demo

<!DOCTYPE html>
      <title>HTML Conditional Comments</title>
      <!--[if IE 9]>
         Special instructions for IE 9 here

      <p>This is demo content.</p>
Updated on 15-Jun-2020 08:22:31