HTML5样板及 Bootstrap

我已经在 Stack 上看到了很多关于 Twitter 鞋带HTML5样板文件的问题。

我知道以下几点:

  • Bootstrap 和 H5BP 不是等价的,它们用于不同的目的
  • 我知道 Bootstrap 是用来做什么的,我每天都在使用它——它是一个前端框架,CSS 和 JS 随时可以使用。只要对选择器/元素应用正确的类,Bootstrap 就可以为您做任何事情。他们的网站上有大量的支持文档,你可以看到他们在框架内提供了什么,以及如何实现它..。
  • 您可以使用 初始化将两者的能力结合起来
  • H5BP 是一个模板... 嗯,这是关于它..。

我还不知道是这样的:

  • H5BP 到底是用来干什么的?当访问他们的网站,他们只给你的源文件,就是这样(哦,是的,和一个视频)。使用它的好处是什么? 为什么要与 Bootstrap 一起使用它?
30430 次浏览

You're exactly right, it is a template. It's a template which brings together a set of best practices for developing HTML5 websites. You don't have to use it but if you do you can rest assured that you are building on a solid foundation which has been developed and honed by top developers over the years. In the words of Paul Irish, one of the principle developers of the project:

“It’s essentially a good starting template of html and css and a folder structure that works., but baked into it is years of best practices from front-end development professionals.”

I would suggest downloading the fully commented version of the boilerplate and reading through the code to give yourself an idea of the thought which has gone into it and the cases it handles. (See also this article which highlights code snippets from the boilerplate which you should be using on your site). These should help you decide whether you want to use it as a starting point for your project or not.

The HTML5bp initializr even includes a bootstrap option, so it couldn't really be any easier!