【发布时间】:2015-08-10 02:03:49
【问题描述】:
Bootstrap.css 对我有用,但 bootstrap.less 不行。我不太确定为什么,我三次检查了我的文件夹,看看 .less 的所有文件是否都在其中,并且它们确实存在。 bootstrap.less 和 bootstrap.css 不是一回事,但更有序吗?为了澄清,这是:
作品:
<link rel = "stylesheet" href="bower_components/bootstrap/less/bootstrap.less">
<title>Backbone Tutorial Blogroll App</title>
</head>
<body>
<h1> Backbone Tutorial Blogroll App</h1>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/underscore/underscore.js"></script>
<script src="bower_components/backbone/backbone.js"></script>
</body>
</html>
不工作:(:
<!DOCTYPE html>
<html lang = "en">
<head>
<link rel = "stylesheet" href="bower_components/bootstrap/less/bootstrap.less">
<link rel = "stylesheet" href="bower_components/bootstrap/bootstrap.css">
<title>Backbone Tutorial Blogroll App</title>
</head>
<body>
<h1> Backbone Tutorial Blogroll App</h1>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/underscore/underscore.js"></script>
<script src="bower_components/backbone/backbone.js"></script>
</body>
</html>
【问题讨论】:
-
浏览器不能直接理解 Less 文件,Less 代码必须先翻译成 CSS。阅读一些Less tutorials 或直接从lesscss.org 开始了解更多信息。
标签: css twitter-bootstrap backbone.js less bower