gpt4 book ai didi

css - AngularJS ng 类不适用于 :hover pseudoclass

转载 作者:行者123 更新时间:2023-11-28 10:03:01 26 4
gpt4 key购买 nike

悬停 psuedoclass 似乎不适用于 ng-class ...有什么想法吗?这是一个示例:

http://jsfiddle.net/75n6w/11/

<style>
.orange {color:orange}
.pointer-hover:hover {
cursor: hand; cursor: pointer;
}
</style>
<table ng-app>
<thead>
<th></th>
<th>Orange<br />class</th>
<th>Rollover<br />psuedoclass</th>
</thead>
<tr>
<td>With class tag</td>
<td class="orange">Orange</td>
<td class="pointer-hover">Hover pointer</td>
</tr><tr>
<td>With ng-class tag</td>
<td ng-class="{orange: 1==true}">Orange</td>
<td ng-class="{pointer-hover: 1==true}">Hover pointer</td>
</tr>
</table>

最佳答案

看看控制台,你有一个错误。只需用撇号包裹您的类(class)名称:

"{'pointer-hover': 1==true}"

更新 fiddle :http://jsfiddle.net/75n6w/12/

关于css - AngularJS ng 类不适用于 :hover pseudoclass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23239997/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com