【问题标题】:Bootstrap.less doesn't load bootstrap stuffBootstrap.less 不加载引导程序的东西
【发布时间】: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


【解决方案1】:

LESS 是一种与 CSS 略有不同的样式表语言。许多项目使用 LESS 编写样式表,并在浏览器中使用之前使用处理器将其转换为 CSS。

您不需要包含 bootstrap.less,只需包含 bootstrap.css,因为 CSS 文件是在某个时候为您从 LESS 文件生成的。

澄清一下,浏览器不能解释任何LESS,只能解释CSS。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-15
    • 2015-02-19
    • 2021-12-31
    • 2014-10-03
    • 2020-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多