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

Masayuki Suzuki picture Masayuki Suzuki · Jan 2, 2017 · Viewed 25.9k times · Source

What is the meaning of lt in the following script?

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

Answer

Jon Uleis picture Jon Uleis · Jan 2, 2017

That's an Internet Explorer conditional comment, which reads out "if using Internet Explorer less than version 9 (IE8 and lower), do this...".

When the conditional passes, HTML5Shiv is run in the browser.

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.