我打开这个html文件 谷歌Chrome 70.0.3538.67 和 :
<!doctype html> <html lang="ru"> <head> <meta charset="utf-8"/> <!-- saved from url=(0014)about:internet --> <title>Sandbox</title> <link href="index.css" rel="stylesheet"/> <script> console.log('Hello all!') </script> <!--[if gt IE 9]> <script> console.log('Hello from IE newer then 9!') </script> <![endif]--> </head> <body> </body> </html>
我希望两个浏览器都有输出:
大家好! 你好,我是9号!
大家好!
条件注释是Internet Explorer专有的,在其他浏览器中不受支持。支持已从IE中删除 version 10