js-mindmap CSS覆盖样式表中的背景颜色

时间:2016-12-26 18:42:56

标签: css

不记得如何在html中覆盖css表中的背景a.node需要是蓝色的。在我的html中我有style="background:blue"关于SO的几个例子还没有解决这个问题 - 它们相似但无法解决。

我的css页面:

body {
background:black;
}
.js-mindmap-active a.node {
    background:red;
    border: 2px solid white;
    -webkit-border-top-left-radius: 20px;
    -webkit-border-bottom-right-radius: 20px;
    -moz-border-radius-topleft: 20px;
    -moz-border-radius-bottomright: 20px;
    border-top-left-radius: 20px;
    border-bottom-right-radius: 20px;    
}
.js-mindmap-active a.node.active {
    padding:5px 10px !important;
    border-width:5px !important;
}
.js-mindmap-active a.node.activeparent {
    padding:5px 10px !important;
    border-width:5px !important;
    background:#8B0000;
}

HTML:

<body>
  <ul>
    <li><a href="http://sample.com/">ALS</a>
      <ul>
        <li><a href="#" target="_blank" style="background:blue">Chest Pain</a></li>
        <li><a href="#" target="_blank" class="icon linkedin">Shortness of Breath</a></li>
        <li><a href="#" target="_blank" class="icon facebook">Allergic Reaction</a></li>
        <li><a href="http://www.google.com" target="_blank" class="icon twitter" title="goo">Diabetic</a></li>
        <li><a href="#">STEMI</a>
        <ul>
            <li><a href="#" target="_blank" class="icon twitter" title="9">ACS</a></li> 
            <li><a href="#" target="_blank" class="icon twitter" title="13">STEMI</a>
              <ul>
                <li><a href="#" title="A">Treatment</a></li> 
                <li><a href="#" title="C">Protocol</a></li> 
              </ul>
            </li> 
        </ul>
        </li>


        </ul>
    </li>
  </ul>
</body>

1 个答案:

答案 0 :(得分:1)

您可以在css属性的末尾添加!important

background:blue !important;

重要的是避免所有级联css

相关问题