【问题标题】:How to add hover for ::before如何为 ::before 添加悬停
【发布时间】:2015-12-02 07:32:57
【问题描述】:

我正在使用剑道日历

这是html

> <table> <tr>  <td role="gridcell" class=""><a tabindex="-1"
> class="k-link" href="#"  data-value="2015/11`enter code here`/1" title="Tuesday,
> December 01, 2015"><div   class="exhibition">1</div></a></td> </tr>
> </table>

悬停时“k-state-hover”类正在添加到 td

<td role="gridcell" class="k-state-hover"><a tabindex="-1"
class="k-link" href="#" data-value="2015/11/1" title="Tuesday,
 December 01, 2015"><div class="exhibition">1</div></a></td>

我想改变“展览”div的“k-state-hover”颜色

我试过这样:

.exhibition::before:hover{
background-color:"red";
}

但它不起作用

【问题讨论】:

    标签: angularjs css kendo-ui


    【解决方案1】:

    使用.exhibition:hover::before 代替.exhibition::before:hover

    【讨论】:

      【解决方案2】:

      你只能在 dom 元素上应用 :hover,而不是像 :before 这样的伪元素。所以无论如何你只能写“.exhibition:hover::before” 但在你的情况下,如果我理解得很好,你想在应用类 k-state-hover 时更改 .exhibition div 的 ::before 的背景颜色,所以你只需要:

      .k-state-hover .exhibition::before{
          background-color:red;
      }
      

      `

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-04-05
        • 2023-03-06
        • 2012-09-04
        • 2023-03-25
        • 1970-01-01
        • 2021-11-22
        • 2021-12-02
        相关资源
        最近更新 更多