gpt4 book ai didi

html - ":active"上的 Firefox anchor 下沉

转载 作者:太空宇宙 更新时间:2023-11-04 12:40:25 26 4
gpt4 key购买 nike

在 firefox 中遇到问题。

你可以在这里看到:link

点击并按住文本“Click Me”下降一个像素。如果您在按住鼠标按钮的同时移开光标,然后在空白处松开 - 文本“Click Me”不会在一个像素上上升。它会在您单击其他元素或空白区域后。
Chrome 没有这种行为。

包括图像以使其更清晰:
1.点击文本和在空白处释放按钮
While clicked on text and after button release on empty space
2.空闲时点击其他元素
On idle and after clicking on other element

操作系统:Windows 8.1
浏览器版本:33.1

代码:

<a href="#">Click Me</a>
a {
position: relative;
}
a:active {
top: 1px;
}

最佳答案

这是 Firefox 的一个已知特性,您可以找到更多相关信息 here

JSFiddle

HTML

<div onclick="location.href='#';" class="link">W3C Web server</div>

将CSS改成这样,

.link {
cursor: pointer;
}

.link:active {
position: relative;
top: 1px;
}

关于html - ":active"上的 Firefox anchor 下沉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26920137/

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