我想使用 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;
}
最佳答案
您不应该直接在 HTML 中使用 less 文件。 Less 是一个 CSS 预处理器,需要编译才能被浏览器读取。
按照此处的示例 (http://lesscss.org/) 来了解如何编译 LESS 文件,以便可以使用 CSS。
关于php - LESS 在 localhost Linux 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26341698/