我在 Internet Explorer 中看到了在 SVG 上使用指针事件的方法,但对于一个元素,我需要更改 href(指针事件:无)。我该怎么做?
(我不能修改代码,只能添加CSS)
谢谢! :)
最佳答案
如果您试图禁用此菜单中的所有 链接,那么在 li< 上有一个涉及
覆盖 anchor 链接。::after
伪元素的 CSS 选项
最佳解决方案是 javascript。
如果你想定位一个特定的列表项/ anchor 组合,你可以使用与第 nth-child 相同的技术。
li:nth-child (insert your number here)
基于给定的结构。
#custom-nav-inner {
display: inline-block;
}
#custom-nav-inner li {
list-style-type: none;
position: relative; /* positioning context */
}
#custom-nav-inner li a {
display: block;
background: #bada55;
padding:0.25rem 1rem;
}
#custom-nav-inner li a:hover {
background: #f06d06;
}
#custom-nav-inner li::after {
content: '';
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
<div id="custom-nav-inner">
<ul>
<li><a href="/">Home</a>
</li>
<li><a href="/the-device">The Device</a>
</li>
<li><a href="/musthaves.html">Musthaves</a>
</li>
</ul>
</div>
关于html - href Internet Explorer 上的指针事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28626337/