从 W3Schools.cn 开始学习 WEB 编程技术

Bootstrap 4 教程

Bootstrap 4 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Bootstrap 4 is completely free to download and use!

Start learning Bootstrap 4 now »

Learn Bootstrap 4


Try it Yourself Examples

This Bootstrap 4 tutorial contains hundreds of Bootstrap 4 examples.

通过本站的在线编辑器,你可以在线修改代码,并运行查看结果。

Responsive Bootstrap Page

Bootstrap 4 实例

<div class="jumbotron text-center">
  <h1>My First Bootstrap Page</h1>
  <p>Resize this responsive page to see the effect!</p>
</div>

<div class="container">
  <div class="row">
    <div class="col-sm-4">
      <h3>Column 1</h3>
      <p>Lorem ipsum dolor..</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 2</h3>
      <p>Lorem ipsum dolor..</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 3</h3>
      <p>Lorem ipsum dolor..</p>
    </div>
  </div>
</div>
亲自试一试 »

点击 "Try it Yourself" 按钮查看运行结果。



Bootstrap 3 vs. Bootstrap 4

Bootstrap 4 is the newest version of Bootstrap; with new components, faster stylesheet and more responsiveness.

Bootstrap 4 supports the latest, stable releases of all major browsers and platforms. However, Internet Explorer 9 and down is not supported.

If you require IE8-9 support, use Bootstrap 3. It is the most stable version of Bootstrap, and it is still supported by the team for critical bugfixes and documentation changes. However, new features will NOT be added to it.

Go To Bootstrap 3 »

Bootstrap 4 Basic Template

We have created a responsive starter template with Bootstrap 4. You are free to modify, save, share, and use it in your projects:


Bootstrap 参考手册

A complete list of all Bootstrap 4 CSS classes with description and examples:

If you want to do more with Bootstrap components, see our complete Bootstrap 4 JavaScript/jQuery reference - all with "Try it Yourself" examples:


Did You Know?

W3.CSS is an excellent alternative to Bootstrap 4.

W3.CSS is smaller, faster, and easier to use.

If you want to learn W3.CSS, go to our W3.CSS Tutorial.