【问题标题】:Internal style sheet being over riden by external css declared earlier in html doc内部样式表被之前在 html doc 中声明的外部 css 覆盖
【发布时间】:2013-08-02 23:51:57
【问题描述】:

我正在使用新的 bootstrap 3.0 玩网站的前端,并通过在 firebug 中刺激来微调事物,但我一直注意到一些奇怪的事情

即使我的<head> 是这样布置的

<link rel="stylesheet" href="bootstrap.css">

<style>
 td {padding:0px;}
<style>

在内部css之前声明外部css(我只在开发期间使用)外部样式仍然超过它们。

要让padding:0px; 工作,我需要将其设置为padding:0px !important;

任何想法为什么会这样......我认为最后声明的 css 总是会覆盖冲突的先前声明的 css。

【问题讨论】:

    标签: css twitter-bootstrap styles


    【解决方案1】:

    CSS 优先级大约是!important、来源(用户与浏览器)、特异性和顺序。 Here 是一个很好的解释。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-24
      相关资源
      最近更新 更多