【问题标题】:Normalize stylesheet with Twitter bootstrap使用 Twitter 引导程序规范化样式表
【发布时间】:2012-12-29 02:21:23
【问题描述】:

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

通常我会使用规范化样式表来帮助我的网站在跨浏览器上看起来更加一致,但 Bootstrap 是否需要这样做?

【问题讨论】:

标签: css twitter-bootstrap normalize


【解决方案1】:

Bootstrap 已使用normalize.css。看看the source(和LESS file):

/*!
 * 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;
}

【讨论】:

    【解决方案2】:

    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 并评估您是否愿意在您的网站上使用它们。

    【讨论】:

      猜你喜欢
      • 2012-05-26
      • 2012-09-12
      • 2017-07-09
      • 2013-03-05
      • 2012-12-20
      • 1970-01-01
      • 2014-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多