I can't get less.js to work and I have no idea why. Heres the HTML i tried:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- CSS -->
<link rel="stylesheet/less" href="main.less" />
<!-- Javascript -->
<!-- <script src="http://lesscss.googlecode.com/files/less-1.0.18.min.js"></script> -->
<script src="less-1.0.18.min.js" type="text/javascript"></script>
</head>
<body>
<p>
Lorum ipsum
</p>
</body>
</html>
And heres main.less:
p {
color: blue;
}
The less-1.0.18.min.js file is downloaded from http://lesscss.googlecode.com/files/less-1.0.18.min.js. All files is in the same folder. I have no idea why this isn't working...
Tested in Chrome 12.0.742.100
Edit
Tried the lates less.js file (less-1.1.3.min.js). That one did also not work.
Okay now...
This works:
<link rel="stylesheet" type="text/less" href="main.less" />
But only as normal css, no less specific markup.
This doesn't work at all:
<link rel="stylesheet/less" type="text/less" href="main.less" />
Also, this isn't working:
<link rel="stylesheet/less" type="text/css" href="main.less" />
What the hell? How do I get less to work?
Found the error
P.S.S. Less.js browser script currently won’t work if you’re using Chrome and the path to your page starts with “file:///” due to a known Chrome issue.
Soruce
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…