How can I compile LESS files within browser

我们两清 提交于 2019-11-28 12:02:59
ie.

This is a piece of documentation:

Client-side usage

Link your .less stylesheets with the rel set to “stylesheet/less”:

<link rel="stylesheet/less" type="text/css" href="styles.less">

Then download less.js from the top of the page, and include it in the <head> element of your page, like so:

<script src="less.js" type="text/javascript"></script>

Make sure you include your stylesheets before the script.

So, you need to:

  1. place link tag before script tag
  2. set rel to “stylesheet/less”
  3. be aware of bug in chrome

Include less file in your html and use some server if u r using google chrome.

you have to use some web server like apache tomcat, uniform server UPX etc in order to compile less in IE. as @ie told include those files in your document before running it in localhost.

Check your web server. Many servers are not initially set up to handle serving LESS files. Specifically newer versions of IIS tend to block serving *.less and need to be configured to do so. You can see if this is happening by loading your LESS CSS file directly from your browser. The easiest way to do that from Firefox is to view your page source and click the link to your LESS file.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!