如何从 Bootstrap 3得到响应网格?

我需要使用 Bootstrap 在我的 web 应用程序中添加响应式设计特性。我只想要响应行为,我不感兴趣的排版,组件或任何其他东西包括在 Bootstrap。

我找到了一个 自定义引导程序版本正在选择网格系统。然而,当我将生成的 CSS 添加到我的应用程序时,我的所有样式(标题、链接和其他)都乱了。为什么会这样?我如何才能得到一个引导 CSS 只有网格系统?我希望避免手动修改 Bootstrap 文件。

103967 次浏览

Just choose Grid system and "responsive utilities" it gives you this: http://jsfiddle.net/7LVzs/

Go to http://getbootstrap.com/customize/ and toggle just what you want from the BS3 framework and then click "Compile and Download" and you'll get the CSS and JS that you chose.

Bootstrap Customizer

Open up the CSS and remove all but the grid. They include some normalize stuff too. And you'll need to adjust all the styles on your site to box-sizing: border-box - http://www.w3schools.com/cssref/css3_pr_box-sizing.asp

I would suggest using MDO's http://getpreboot.com/ instead. As of v2, preboot back ports the LESS mixins/variables used to create the Bootstrap 3.0 Grid System and is much more light weight than using the CSS generator. In fact, if you only include preboot.less there is NO overhead because the entire file is made up of mixins/variables and therefore are only used in pre-compilation and not the final output.

Checkout zirafa/bootstrap-grid-only. It contains only the bootstrap grid and responsive utilities that you need (no reset or anything), and simplifies the complexity of working directly with the LESS files.

Made a Grunt build with the Bootstrap 3.3.5 grid only:

https://github.com/horgen/grunt-builds/tree/master/bootstrap-grid

~10KB minimized.

If you need some other parts from Bootstrap just include them in /src/less/bootstrap.less.

It looks like you can download just the grid now on Bootstrap 4s new download features.

It's been a while since this question was asked, but maybe now you can forego Bootstrap altogether and use CSS Grid! (it's simpler, neater, more flexible and faster). See this cool article: Stop using Bootstrap — create a practical CSS Grid template for your component based UI

In Bootstrap 4, there are already separated files in their GitHub. You can find them here

https://github.com/twbs/bootstrap/tree/main/dist/css