`[if lt IE 9]` 中的 `lt` 是什么意思

What is the meaning of `lt` in `[if lt IE 9]`

下面脚本中的lt是什么意思?

<!--[if lt IE 9]>
  <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js">
  </script>
<![endif]-->

这是一个 Internet Explorer conditional comment,它显示 "if using Internet Explorer less than version 9 (IE8 and lower), do this..."。

当条件通过时,HTML5Shiv 在浏览器中是 运行。

HTML5Shiv is a JavaScript workaround, created by Sjoerd Visscher, to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9, which do not allow unknown elements to be styled without JavaScript.

与"less than"意思相同。您可能会遇到的替代比较运算符列表如下:

  • lt <(小于)
  • gt >(大于)
  • eq ==(等于)
  • ne !=(不等于)
  • gte >=(大于等于)
  • lte <=(小于等于)

(固定 less/greater 或相等运算符)