【问题标题】:How can I get less.js and bootstrap to work?我怎样才能让 less.js 和 bootstrap 工作?
【发布时间】:2013-04-26 19:11:12
【问题描述】:

我正在尝试让 bootstrap 和 less.js 工作,但我无法成功... 过去我的工作量很少,所以我想知道我是否遗漏了什么…… 它在 Synology 服务器上运行。在运行时,它似乎生成了 boostrap css,因为它应该将“less:sandbox-css-bootstrap”附加到 html 但它没有从 variables.less 中获取值

这是我的头

<meta charset="utf-8">   

<style>
 body {
    padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
  }
</style>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<link rel="stylesheet/less" type="text/css" href="css/bootstrap.less">  
<script type="text/javascript" src="js/less-1.3.3.min.js"></script>


<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="../assets/js/html5shiv.js"></script>
<![endif]-->

有谁知道我做错了什么? 提前感谢

【问题讨论】:

  • 关闭链接标签有帮助吗?
  • Nope :/ 我发现很奇怪的是生成了 css 但它忽略了 variables.less 的值
  • type="text/javascript" 添加到引导脚本标签。
  • 您是否尝试在您的 .less &lt;link&gt; 之前加载您的 Less js
  • @Mark 我已经尝试过了...

标签: javascript css twitter-bootstrap less


【解决方案1】:

更改初始化的顺序。将依赖项置于其他依赖项之上。比如将 bootstrap.less 放在所有其他 CSS 之上

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-27
    • 2021-01-22
    • 2011-04-26
    • 1970-01-01
    • 2017-12-24
    • 2014-10-21
    • 1970-01-01
    • 2013-07-22
    相关资源
    最近更新 更多