element.style 不会被自定义 css 覆盖

时间:2021-04-28 17:51:25

标签: css wordpress overriding

我是 WordPress 的新手,正在开发我的第一个网站。我正在使用一个实时聊天插件,它的颜色不是我喜欢的。看到按钮的背景颜色是使用内联 CSS 设置的,我尝试使用子主题覆盖背景颜色。但是,出于某种原因,它并没有覆盖颜色。我尝试了以下代码,但似乎没有任何效果。

    #divClosedChatBar {
        background-color: #222;
    }

    #divClosedChatBar {
        background-color: #222 !important;
    }

    #divClosedChatBar[style] {
        background-color: #222 !important;
    }
    <div id="divClosedChatBar" style="position:relative;width:205px;height:38px;top:0px;right:0px;bottom:0px;left:0px;overflow:hidden;border:0px;margin:0px;padding:0px;background-color:#1B68FF;text-align:center;cursor:pointer;vertical-align:middle;border-top-right-radius:5px;-webkit-border-top-right-radius:5px;-moz-border-top-right-radius:5px;border-top-left-radius:5px;-webkit-border-top-left-radius:5px;-moz-border-top-left-radius:5px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;">
        <div id="divUnreadMessages" style="float:left;position:absolute;height:16px;line-height:16px;margin-left:5px;margin-top:11.5px;padding: 0px;background-color:#FE6700;border-radius: 4px;">
            <span id="txtUnreadMessages" style="display:none;padding:0px 3px 1px 3px; color:white;font-weight:bold;background: -webkit-gradient(linear, left top, left bottom, from(#FE9504), to(#FE6700));background: -moz-linear-gradient(top,  #FE9504,  #FE6700);-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;">0</span>
        </div>
        <span id="txtHelpChat" style="display:inline-block;cursor:pointer;margin-top:10.5px;margin-right:auto;margin-left:auto;font-size:15px;color:#FFFFFF;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;">Leave us a message</span>
    </div>

0 个答案:

没有答案
相关问题