在CSS中,如果我们需要禁止a标签跳转,我们可以使用以下代码: a { pointerevents: none; cursor: default; } 这段代码的意思是将a标签的鼠标事件取消掉,同时将...
在CSS中,如果我们需要禁止a标签跳转,我们可以使用以下代码:
a {
pointer-events: none;
cursor: default;
}
a[href='#'] {
color: red;
font-size: 16px;
}