gpt4 book ai didi

html - 指针事件 : none is not working

转载 作者:太空狗 更新时间:2023-10-29 13:40:47 25 4
gpt4 key购买 nike

我正在创建一个 Web 应用程序,我在其中制作了一张可点击的卡片。我想为零机会禁用 anchor 标记上的点击事件。

但是 pointer-events: none; 不工作。

我在这里设置了一个片段以便更好地理解。

.fc-card-header {
background: #1976d2;
padding: 24px;
height: auto;
border-radius: 3px;
display: block;
}
.svg-icon svg {
width: 24px;
height: 24px;
fill: rgba(0,0,0,0.54);
}
<a href="cmOpportunitySummary" class="white" style="text-decoration:none;pointer-events: none; cursor: default;;">
<div class="fc-card-header">
<div class="grid-row">
<div class="grid-cell text-left no-padding padding-right cell-auto-width">
<div class="svg-icon no-width no-padding white" data-role="ico_RoundStar"><svg viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"></path> <path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23L16.23 18z"></path></svg></div>
</div>
<div class="grid-cell no-padding flex flex-vcenter">
<p class="text-left white">Opportunities</p>
</div>
</div>
<div class="grid-row padding-top">
<div class="grid-cell no-padding padding-top padding-bottom text-left flex flex-vcenter">
<span class="heading white no-line-height">0</span>
</div>
</div>
</div>
</a>

最佳答案

a 标签上使用 display:block;display:inline-block;,它会起作用。

a {
text-decoration: none;
pointer-events: none;
cursor: default;
display: block;
color: #fff;
}
.fc-card-header {
background: #1976d2;
padding: 24px;
height: auto;
border-radius: 3px;
display: block;
}
.svg-icon svg {
width: 24px;
height: 24px;
fill: rgba(0, 0, 0, 0.54);
}
<a href="cmOpportunitySummary" class="white">
<div class="fc-card-header">
<div class="grid-row">
<div class="grid-cell text-left no-padding padding-right cell-auto-width">
<div class="svg-icon no-width no-padding white" data-role="ico_RoundStar">
<svg viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"></path>
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23L16.23 18z"></path>
</svg>
</div>
</div>
<div class="grid-cell no-padding flex flex-vcenter">
<p class="text-left white">Opportunities</p>
</div>
</div>
<div class="grid-row padding-top">
<div class="grid-cell no-padding padding-top padding-bottom text-left flex flex-vcenter">
<span class="heading white no-line-height">0</span>
</div>
</div>
</div>
</a>

关于html - 指针事件 : none is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42224761/

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