bootstrap、bulma 和 materialize-css 都是旨在加速用户界面开发的前端 CSS 框架。bootstrap 是最成熟的方案,提供完整的 CSS 和 JavaScript 组件库,适合需要开箱即用交互功能的项目。bulma 专注于纯 CSS,基于 Flexbox 构建,要求开发者自行处理 JavaScript 交互,适合偏好轻量级样式层的项目。materialize-css 实现了 Google 的 Material Design 规范,但目前社区维护活跃度较低,更适合维护旧项目而非开启新工程。
这三个库都旨在加速 UI 开发,但设计哲学和适用场景截然不同。bootstrap 是全能型选手,bulma 是纯 CSS 极简派,而 materialize-css 则是特定设计规范的实现者。让我们从工程角度对比它们如何处理常见任务。
bootstrap 使用基于行的网格系统,支持响应式断点。
.container 和 .row 中。.col-* 类控制。<!-- bootstrap: 标准网格 -->
<div class="container">
<div class="row">
<div class="col-md-6">左半部分</div>
<div class="col-md-6">右半部分</div>
</div>
</div>
bulma 完全基于 Flexbox,语法更简洁。
.columns 和 .column。<!-- bulma: Flexbox 网格 -->
<div class="columns">
<div class="column is-half">左半部分</div>
<div class="column is-half">右半部分</div>
</div>
materialize-css 类似 Bootstrap,但类名不同。
.row 和 .col。s (small), m (medium), l (large)。<!-- materialize-css: 材料设计网格 -->
<div class="row">
<div class="col s12 m6">左半部分</div>
<div class="col s12 m6">右半部分</div>
</div>
bootstrap (v5+) 内置原生 JavaScript 组件。
// bootstrap: 初始化弹窗
const modal = new bootstrap.Modal(document.getElementById('myModal'));
modal.show();
bulma 不包含 JavaScript。
.is-active 类。// bulma: 手动控制模态框
const modal = document.getElementById('modal');
modal.classList.add('is-active');
// 关闭时需手动移除类
materialize-css 依赖 jQuery (旧版) 或原生 JS (v1.0)。
// materialize-css: 初始化组件
const elems = document.querySelectorAll('.modal');
const instances = M.Modal.init(elems);
instances[0].open();
bootstrap 提供强大的 Sass 映射配置。
// bootstrap: 自定义变量
$primary: #ff5722;
$enable-rounded: false;
@import "bootstrap/scss/bootstrap";
bulma 使用 Sass 变量控制颜色和尺寸。
// bulma: 自定义变量
$primary: #ff5722;
$family-sans-serif: "Helvetica Neue";
@import "bulma/bulma";
materialize-css 提供颜色工具和变量。
// materialize-css: 自定义变量
$primary-color: #ff5722;
@import "materialize";
bootstrap 处于活跃维护状态。
// bootstrap: 持续更新
// npm install bootstrap@latest
bulma 维护频率较低但稳定。
// bulma: 稳定版本
// npm install bulma@0.9.3
materialize-css 基本处于维护模式。
// materialize-css: 注意版本
// npm install materialize-css@1.0.0
// 建议评估 @material/web 等替代方案
尽管差异明显,这三个库在基础层面有很多相似之处。
/* 所有框架都支持类似媒体查询逻辑 */
@media (min-width: 768px) { /* ... */ }
<!-- 所有框架都有类似类名 -->
<button class="btn-primary">主要操作</button>
// 所有框架都支持 npm 安装
import 'bootstrap/dist/css/bootstrap.css';
import 'bulma/css/bulma.css';
import 'materialize-css/dist/css/materialize.min.css';
| 特性 | bootstrap | bulma | materialize-css |
|---|---|---|---|
| JS 依赖 | ✅ 内置 (原生) | ❌ 无 | ✅ 内置 (需初始化) |
| 网格基础 | 🗂️ 行/列系统 | 🧩 Flexbox | 🗂️ 行/列系统 |
| 设计风格 | 🎨 通用中性 | 🎨 简洁现代 | 🎸 Material Design |
| 维护状态 | 🟢 活跃 | 🟡 稳定 | 🟠 低频/维护模式 |
| 学习曲线 | 📉 中等 | 📉 低 | 📉 中等 |
bootstrap 是稳妥的选择 🛡️——适合需要快速交付、依赖组件库且团队规模较大的企业项目。它的生态最完善,风险最低。
bulma 是灵活的选择 🧩——适合现代前端栈(如 Vue/React),希望样式层轻量且可控的项目。你需要自己处理交互,但换来的是更干净的 DOM。
materialize-css 是特定的选择 🎨——仅建议在必须严格遵循 Material Design 且不使用 Angular/Vue/React 组件库时使用。对于新项目,建议优先考虑 @material/web 或框架专用的 Material 实现。
核心思考:框架选型不仅是选样式,更是选维护责任。bootstrap 替你承担交互逻辑,bulma 把控制权交给你,而 materialize-css 则需注意长期维护成本。根据团队技术栈和项目周期做出明智选择。
选择 bootstrap 如果你需要稳定的企业级方案,且希望弹窗、提示框等交互组件开箱即用,无需自己写 JS 逻辑。它拥有最大的社区支持,遇到问题时容易找到解决方案,适合后台管理系统或快速原型开发。
选择 bulma 如果你偏好纯 CSS 方案,打算自己搭配 Vue 或 React 处理交互,且喜欢基于 Flexbox 的简洁网格系统。它的类名可读性强,没有 JavaScript 依赖,适合追求轻量级样式层且技术栈灵活的项目。
仅在维护旧项目或强需 Material 风格且不使用 React/Vue 组件库时考虑,新项目建议评估更活跃的替代方案。由于维护频率较低,长期来看可能存在安全更新滞后或兼容性风险,需谨慎使用。
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
Explore Bootstrap docs »
Report bug
·
Request feature
·
Blog
Our default branch is for development of our Bootstrap 5 release. Head to the v4-dev branch to view the readme, documentation, and source code for Bootstrap 4.
Several quick start options are available:
git clone https://github.com/twbs/bootstrap.gitnpm install bootstrap@v5.3.8yarn add bootstrap@v5.3.8bun add bootstrap@v5.3.8composer require twbs/bootstrap:5.3.8Install-Package bootstrap Sass: Install-Package bootstrap.sassRead the Getting started page for information on the framework contents, templates, examples, and more.
Within the download you’ll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.
bootstrap/
├── css/
│ ├── bootstrap-grid.css
│ ├── bootstrap-grid.css.map
│ ├── bootstrap-grid.min.css
│ ├── bootstrap-grid.min.css.map
│ ├── bootstrap-grid.rtl.css
│ ├── bootstrap-grid.rtl.css.map
│ ├── bootstrap-grid.rtl.min.css
│ ├── bootstrap-grid.rtl.min.css.map
│ ├── bootstrap-reboot.css
│ ├── bootstrap-reboot.css.map
│ ├── bootstrap-reboot.min.css
│ ├── bootstrap-reboot.min.css.map
│ ├── bootstrap-reboot.rtl.css
│ ├── bootstrap-reboot.rtl.css.map
│ ├── bootstrap-reboot.rtl.min.css
│ ├── bootstrap-reboot.rtl.min.css.map
│ ├── bootstrap-utilities.css
│ ├── bootstrap-utilities.css.map
│ ├── bootstrap-utilities.min.css
│ ├── bootstrap-utilities.min.css.map
│ ├── bootstrap-utilities.rtl.css
│ ├── bootstrap-utilities.rtl.css.map
│ ├── bootstrap-utilities.rtl.min.css
│ ├── bootstrap-utilities.rtl.min.css.map
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ ├── bootstrap.min.css.map
│ ├── bootstrap.rtl.css
│ ├── bootstrap.rtl.css.map
│ ├── bootstrap.rtl.min.css
│ └── bootstrap.rtl.min.css.map
└── js/
├── bootstrap.bundle.js
├── bootstrap.bundle.js.map
├── bootstrap.bundle.min.js
├── bootstrap.bundle.min.js.map
├── bootstrap.esm.js
├── bootstrap.esm.js.map
├── bootstrap.esm.min.js
├── bootstrap.esm.min.js.map
├── bootstrap.js
├── bootstrap.js.map
├── bootstrap.min.js
└── bootstrap.min.js.map
We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). Source maps (bootstrap.*.map) are available for use with certain browsers’ developer tools. Bundled JS files (bootstrap.bundle.js and minified bootstrap.bundle.min.js) include Popper.
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Bootstrap’s documentation, included in this repo in the root directory, is built with Astro and publicly hosted on GitHub Pages at https://getbootstrap.com/. The docs may also be run locally.
Documentation search is powered by Algolia's DocSearch.
npm install to install the Node.js dependencies, including Astro (the site builder).npm run test (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets./bootstrap directory, run npm run docs-serve in the command line.Learn more about using Astro by reading its documentation.
You can find all our previous releases docs on https://getbootstrap.com/docs/versions/.
Previous releases and their documentation are also available for download.
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
Moreover, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the Code Guide, maintained by Mark Otto.
Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at https://editorconfig.org/.
Get updates on Bootstrap’s development and chat with the project maintainers and community members.
irc.libera.chat server, in the #bootstrap channel.bootstrap-5).bootstrap on packages which modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we adhere to those rules whenever possible.
See the Releases section of our GitHub project for changelogs for each release version of Bootstrap. Release announcement posts on the official Bootstrap blog contain summaries of the most noteworthy changes made in each release.
Mark Otto
Jacob Thornton
Thanks to BrowserStack for providing the infrastructure that allows us to test in real browsers!
Thanks to Netlify for providing us with Deploy Previews!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Thank you to all our backers! 🙏 [Become a backer]
Code and documentation copyright 2011-2025 the Bootstrap Authors. Code released under the MIT License. Docs released under Creative Commons.