【问题标题】:Style referenced by a spacebar code is not applied不应用空格代码引用的样式
【发布时间】:2023-02-04 18:46:09
【问题描述】:

对不起,我想不出一个更好的标题。我正在尝试根据函数调用的结果来设置表格的样式。 在我的 HTML 文件中,我有以下内容:

<tr class="customers-new {{result}}">  //result can be 'checked' or ''

然后在我的 CSS 中:

tr.customers-new {
  td {
    cursor: default;
  }

  .checked {
    background: @light-color;
    cursor: default;
  }

}

只是不应用样式。我也试过 td.checked。

【问题讨论】:

  • 你想将. checked css 应用到tr 还是td
  • 只是为了TD。我也试过 td.checked

标签: html css meteor


【解决方案1】:

正如您所澄清的那样,您正在尝试将 CSS 放入 td,您可以将 td 放入 .checked 中,如下所示

tr.customers-new {
  td {
    cursor: default;
  }
  .checked {
    td {
      background: @light-color;
      cursor: default;
    }
  }
}

【讨论】:

  • 谢谢,但它似乎没有帮助。我可以看到使用了正确的样式名称(已选中 customers-new),但仍未应用该样式。
猜你喜欢
  • 2020-02-01
  • 1970-01-01
  • 2018-09-05
  • 2015-10-01
  • 2020-07-04
  • 1970-01-01
  • 2010-09-24
  • 1970-01-01
  • 2021-12-22
相关资源
最近更新 更多