href Internet Explorer 上的指针事件
pointer-events on a href Internet Explorer
我在 Internet Explorer 中看到了在 SVG 上使用指针事件的方法,但对于一个项目,我需要更改 href(指针事件:none)。我该怎么做?
(我无法更改代码,只能添加CSS)
谢谢! :)
如果您试图禁用此菜单中的 所有 link,则有一个涉及 ::after
伪的 CSS 选项- li
上覆盖锚 link.
的元素
最优解是javascript。
如果您想定位特定的列表项/锚点组合,您可以使用与第 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>
我在 Internet Explorer 中看到了在 SVG 上使用指针事件的方法,但对于一个项目,我需要更改 href(指针事件:none)。我该怎么做?
(我无法更改代码,只能添加CSS)
谢谢! :)
如果您试图禁用此菜单中的 所有 link,则有一个涉及 ::after
伪的 CSS 选项- li
上覆盖锚 link.
最优解是javascript。
如果您想定位特定的列表项/锚点组合,您可以使用与第 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>