我经常在网页中看到下面的href。然而,我不明白这是要做什么,也不明白这是什么技术。有没有人能详细解释一下?
<a href="javascript:;"></a>发布于 2020-10-23 22:09:06
由于这是一个样式问题,而不是用无效语法污染HTML.您可以/应该使用W3有效的解决方法:
遵循W3 accessibility guide lines for buttons.
href。这里有一个live example供你试用UX。
HTML
<a role="button" aria-pressed="false">Underlined + Pointer</a>
<a role="button" aria-pressed="false" class="btn">Pointer</a>CSS
a[role="button"]:not([href]):not(.btn) { text-decoration: underline; }
a[role="button"]:not([href]) { cursor: pointer; }https://stackoverflow.com/questions/7755088
复制相似问题