加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – Twitter Bootstrap响应式css不是从较少的

发布时间:2020-12-17 20:39:02 所属栏目:安全 来源:网络整理
导读:我已经从 download with docs链接下载了.less文件,并将其添加到我的项目中.我已经下载了less.js并将其添加到我的项目中.如果我在页面的头部包含以下内容: link rel="stylesheet/less" href="@routes.Assets.at("less/bootstrap.less")" script src="@routes
我已经从 download with docs链接下载了.less文件,并将其添加到我的项目中.我已经下载了less.js并将其添加到我的项目中.如果我在页面的头部包含以下内容:

<link rel="stylesheet/less" href="@routes.Assets.at("less/bootstrap.less")">
    <script src="@routes.Assets.at("less/less-1.3.0.min.js")"></script>

引导程序似乎工作,减去响应部分(即如果浏览器窗口变得太窄,导航栏将不会崩溃).我可以通过手动添加bootstrap-responsive.css来解决这个问题

<link rel="stylesheet" href="@routes.Assets.at("stylesheets/bootstrap-responsive.css")" />

问题是,如果我想修改我的页面的颜色主题,我需要编辑bootstrap-responsive.css中的颜色值,这是一个痛苦.看起来有些.less文件用于生成bootstrap-responsive.css(例如responsive-navabar.less),但它们无法正常工作.

关于如何从.less文件中获取bootstrap-responsive.css文件的任何建议?

解决方法

您还需要明确包含此文件:

responsive.less

假设您使用的是Twitter Bootstrap的最新版本(2.0.x).

正如他们的网站(http://twitter.github.com/bootstrap/scaffolding.html#responsive)所述:

Bootstrap doesn’t automatically include these media queries,but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:

  1. Use the compiled responsive version,bootstrap-responsive.css
  2. Add @import “responsive.less” and recompile Bootstrap
  3. Modify and recompile responsive.less as a separate file

Why not just include it? Truth be told,not everything needs to be responsive. Instead of encouraging developers to remove this feature,we figure it best to enable it.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读