Html 禁用链接<;a>;内部<;李>;
我有以下HTML:Html 禁用链接<;a>;内部<;李>;,html,css,Html,Css,我有以下HTML: <li> <a href="mylink">Some text</a> </li> 我也尝试过: li.disabled a { pointer-events: none; cursor: default; opacity: 0.6; } li.disabled a:hover { pointer-events: none; cursor: default; opacity: 0.6; } 根
<li>
<a href="mylink">Some text</a>
</li>
我也尝试过:
li.disabled a {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
li.disabled a:hover {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
根据,chrome不支持指针事件
,因此此解决方案应该可以帮助您:
HTML
在Firefox的ChromeWorks中,这两款软件也同样适用于我。编辑:在微软的边缘不起作用。谢谢你们,我猜是精神错乱和精神错乱开始了。我现在就去睡觉,明天再试一次。放在这里是为了完整。
li.disabled {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
li.disabled:hover {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
li.disabled a {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
li.disabled a:hover {
pointer-events: none;
cursor: default;
opacity: 0.6;
}
<ul>
<li class="disabled">
<a href="http://google.com">Some text</a>
</li>
</ul>
li.disabled a {
cursor: default;
opacity: 0.6;
}
li.disabled{
position: relative;
}
li.disabled:before{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
content: "";
opacity: 0;
}