不能让less.js工作 [英] Can't get less.js to work

查看:84
本文介绍了不能让less.js工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能让less.js工作,我不知道为什么。我试过的HTML:

 <!DOCTYPE HTML> 
< html lang =en>
< head>
< meta charset =utf-8/>

<! - CSS - >
< link rel =stylesheet / lesshref =main.less/>

<! - Javascript - >
<! - < script src =http://lesscss.googlecode.com/files/less-1.0.18.min.js>< / script> - >
< script src =less-1.0.18.min.jstype =text / javascript>< / script>

< / head>
< body>
< p>
Lorum ipsum
< / p>
< / body>
< / html>

和heres main.less:

  p {
color:blue;
}

less-1.0.18.min.js文件是从 http://lesscss.googlecode.com/files/less-1.0.18.min.js 。所有文件都在同一个文件夹中。我不知道为什么这不工作...



在Chrome 12.0.742.100测试



strong>编辑



尝试了lates less.js文件(less-1.1.3.min.js)。


$ b

works:

 < link rel =stylesheettype =text / lesshref =main.less/> ; 

但是只有正常的css,不少特定的标记。



这根本不起作用:

 < link rel =stylesheet / lesstype = text / lesshref =main.less/> 

此外,这不工作:

 < link rel =stylesheet / lesstype =text / csshref =main.less/& 

到底是什么?

$ b $ b

PSS由于已知的Chrome问题,Less.js浏览器脚本目前无法使用Chrome,并且您的网页的路径以file:///开头。


Soruce

解决方案


PSS如果您使用
Chrome,并且由于已知的
Chrome问题,您的网页路径以file:///开头,Less.js浏览器脚本将无法正常工作。


但我们可以做的是使用wamp(pc)或mamap(mac)设置本地测试环境。它会正常工作。


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

解决方案

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.

But what we could do is setting up a local testing environment using wamp (pc) or mamap (mac). It will work alright then.

这篇关于不能让less.js工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆