使用Twitter Bootstrap规范化样式表

8

我刚开始一个使用 Twitter Bootstrap 的项目,想知道它是否有自己的重置规则。

通常我会添加一份 normalize 样式表来帮助我的网站在不同浏览器下看起来更加一致,但是在使用 Bootstrap 的情况下是否需要呢?


它使用normalize.css - Jonathan de M.
2个回答

22

Bootstrap已经使用了normalize.css。请查看源代码(以及LESS文件):

/*!
 * Bootstrap v2.2.2
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}

3

Bootstrap v3现在明确指出了这一点,并且还包括版本号:

/*!
 * Bootstrap v3.0.3 (http://getbootstrap.com)
 * Copyright 2013 Twitter, Inc.
 * Licensed under http://www.apache.org/licenses/LICENSE-2.0
 */

/*! normalize.css v2.1.3 | MIT License | git.io/normalize */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
  display: block;
}

请注意,normalize.css现在已经更新到v3.0.0-rc.1,因此您可能希望查看CHANGELOG或diff,并评估是否想在您的网站上使用它们。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接