php - LESS 在 localhost Linux 上不起作用

标签 php css linux less localhost

我想使用 LESS,但它在我的本地主机上不起作用。

这是我的index.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; utf-8">
  <link rel="stylesheet/less" type="text/css" href="styles.less">
  <script src="less.js" type="text/javascript"></script>
  </head>
  <body>

</body>
</html>

这是我的 styles.less

@nice-blue: #5B83AD;

body{
backgroud-color: @nice-blue;
}

And here is my page and firebug

最佳答案

您不应该直接在 HTML 中使用 less 文件。 Less 是一个 CSS 预处理器,需要编译才能被浏览器读取。

按照此处的示例 (http://lesscss.org/) 来了解如何编译 LESS 文件,以便可以使用 CSS。

关于php - LESS 在 localhost Linux 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26341698/

相关文章:

php - mysql_real_escape_string() 之后如何处理爱尔兰语(例如 O'Brien、O'Connor)?

php - 不显示上传文件大小> 2mb

javascript - 输入:invalid in html using javascript时清空输入框

javascript - jQuery 轮播幻灯片动画

php - 如何将自定义文件字段添加到 WordPress 中的用户配置文件?

php - 上传到Mysql数据库时出错

html - 电子邮件模板,适用于除 Outlook 以外的所有客户端

Linux : Activating twice the same module with differents parameters

linux - 挂载 SD 卡镜像 - 更改分区上的文件并写回

linux - pthread在linux kernel 3.2中是如何实现的?