开始使用Bulma

使用Bulma仅仅需要1个CSS文件

Bulma is a CSS library. This means it provides CSS classes to help you style your HTML code.
To use Bulma, you can either use the pre-compiled .css file or install the .sass files so you can customize it to your needs.

Get the Bulma CSS file

A single .css file that includes all of Bulma

Recommended Option 1. Use a CDN

You can import the CSS file directly from jsDelivr:

@import "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css";
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">

The RTL version is also available:

@import "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma-rtl.min.css";
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma-rtl.min.css">

Bulma is also available via cdnjs.

Option 2. Download the Github release

You can get the latest Bulma release as a .zip from GitHub:
Download v0.9.4

Or

Get the Bulma Sass library

A collection of .sass files to build your own version of Bulma

Recommended Option 1. Install the NPM package

Bulma is available through npm:

npm install bulma
yarn add bulma

Bulma is also available via cdnjs.

Option 2. Clone the GitHub repository

Bulma is available on GitHub:

git clone [email protected]:jgthms/bulma.git
git clone https://github.com/jgthms/bulma.git
gh repo clone jgthms/bulma
Note that the GitHub repository also includes this documentation, so it’s significantly bigger than the NPM package.

必要的代码(Code requirements) #

为了让Bulma正确的工作,你需要网页是响应式的

1

使用 HTML5 doctype声明

<!DOCTYPE html>

2

添加响应式 viewport meta 标签

<meta name="viewport" content="width=device-width, initial-scale=1">

开始模板(Starter template) #

如果你想立刻开始, 你可以使用 开始模板(starter template). 只需要 复制/粘贴 下面的代码到文件中,并保存即可.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hello Bulma!</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
  </head>
  <body>
  <section class="section">
    <div class="container">
      <h1 class="title">
        Hello World
      </h1>
      <p class="subtitle">
        My first website with <strong>Bulma</strong>!
      </p>
    </div>
  </section>
  </body>
</html>

bulma-start #

bulma-start 是一个很小的npm软件包,它当中仅包含了使用Bulma构建网站所需要的npm依赖项.

查看Bulma-start