【问题标题】:Css background-color: none; [duplicate]CSS背景颜色:无; [复制]
【发布时间】:2018-01-18 15:41:00
【问题描述】:

我如何使用绿色

我如何禁用“.ladda-button[disabled]:hover”按钮颜色,因为此类在页面加载后添加到 jQuery 中

.ladda-button[disabled], .ladda-button[disabled]:hover, .ladda-button[data-loading], .ladda-button[data-loading]:hover { 背景颜色:无; }

.ladda-button[disabled], 
.ladda-button[disabled]:hover, 
.ladda-button[data-loading], 
.ladda-button[data-loading]:hover {
    cursor: default;
    background-color: #111;
 }

.btn-success.disabled, .btn-success:disabled {
    background-color: #00644a;
    border-color: #00644a;
}

.ladda-button[disabled], 
.ladda-button[disabled]:hover, 
.ladda-button[data-loading], 
.ladda-button[data-loading]:hover {
    background-color: none;
}

【问题讨论】:

  • 你试过添加 !important 吗?
  • 如何禁用“.ladda-button[disabled]:hover”按钮颜色,因为此类在页面加载后添加到 jQuery
  • 如果它是从cdn生成的,你不能禁用它......所以在你的css代码中输入重要的,这样它就可以替换jquery的cdn内容
  • 您能否将您的 html 发布到您的问题中,以便我们提供修复。而不是 !important 我建议改用 css specificity - 选择器越具体,它就越精确;在合理范围内。

标签: html css twitter-bootstrap sass


【解决方案1】:

将以下行添加到您的 css

.ladda-button[disabled] .ladda-button[disabled]:hover {
  background-color: rgba(0, 0, 255, 0) !important
}

在这里,给你想要的背景颜色。我已经给透明了。

【讨论】:

  • 仅供参考,它拼写为“透明”,以防您使用 rgba() 仅仅是因为您不知道如何正确拼写它(这是公平的,它不是最容易拼写的词)。仍然没有理由使用 !important。
  • 使用重要覆盖默认 css。就我而言,我总是更喜欢使用重要来覆盖默认 css。我拼写错误,它是打字错误。我现在已经编辑了。
  • @BoltClock : 这里的每个人都不是以英语为母语的人。
  • @Nitin Dhomse:这就是为什么我指出“这不是最容易拼写的词”。
  • @Samiksha Jagtap:好吧,在这种情况下,我很困惑为什么您没有在 CSS 中使用“透明”。对于任何人来说, 使用它并使用 rgba() 来代替是非常不寻常的。不,你不需要 !important 来覆盖“默认 css”,不管这意味着什么。
猜你喜欢
  • 2017-11-01
  • 1970-01-01
  • 2014-08-09
  • 2021-04-22
  • 2014-08-03
  • 1970-01-01
  • 2012-01-01
  • 1970-01-01
  • 2023-03-26
相关资源
最近更新 更多