具有 16 列而不是 12 列的 Bootstrap CDN

Boostrap CDN with 16-columns instead of 12

我想使用最新的 Bootstrap CDN,但它默认为 12 列布局。自定义 16 列布局的唯一方法是自己下载和托管文件吗?

编辑:我问的是如何通过 CDN 获取 bootstrap。我使用 https://cdnjs.com/ 的 bootstrap CDN,效果很好,除了它是 12 列布局。

您可以自定义大多数 Bootstrap 配置和默认值 values.In 您可以在 .less.

中设置 @grid-columns

但是您仍然可以从 http://getbootstrap.com/customize/#grid-system

获得自定义 Bootstrap

只需设置Number of columns in the grid.并点击页面末尾的"Compile and Download"。

我认为你可以使用 bootstrap 的 cdn 版本,然后去自定义并只下载 css 调整网格系统。

因此您将拥有来自 cdn 的主要 bootstrap 文件,以及第二个文件中的覆盖网格 类。确保首先加载 cdn 版本。

实际上只有 2 个选项可以做到这一点。

  1. 您可以使用自己的 css 文件覆盖 bootstraps 网格系统。

    <link rel="stylesheet" href="/cdn/path/to/bootstrap.css" />
    <link rel="stylesheet" href="/my/path/overide_bootstrap.css" />
    

    这可能是一项乏味的任务,我不建议这样做。

  2. 自定义 Bootstrap 并使用您自己的版本

    如果你去http://getbootstrap.com/customize/ you can customize and download a fully customized version of Bootstrap. Specifically for what you are looking for is located at http://getbootstrap.com/customize/#grid-system.

下载完成后,您有几个选择:

  1. 自己从自己的项目中提供文件。
  2. 使用免费的 CDN 服务

    您可以使用多种 CDN 服务,例如 CloudFlare (https://www.cloudflare.com/features-cdn) or you can use cdnjs (https://github.com/cdnjs/cdnjs#adding-a-new-or-updating-an-existing-library)

希望对您有所帮助!