a: 访问过的 {textdecoration: none} 在 Firefox 中不起作用

发布于 2025-01-07 18:21:41 字数 603 浏览 4 评论 0原文

我有一个图像,它是一个链接。当我点击它时,它会将我发送到某个地方,然后如果我点击返回返回到该页面,则该图像周围有一个 1px 的蓝色虚线边框。此外,如果我点击它并按住,边框就会变成红色。这看起来真的很糟糕,我找不到删除该边框的方法。 我已经尝试过 with

a:visited {text-decoration: none}
a:active {text-decoration: none}

和 with:

a:visited img{text-decoration: none}
a:active img{text-decoration: none}

没有效果。 顺便说一句,这个边框在chrome中不会出现。

这是我对该图像的 css 代码:

#back_to_photos{
float:right;
position: relative;
margin-top:-238px;
margin-right: 40px;

}
a:visited {text-decoration: none}
a:active {text-decoration: none}

谢谢!

I have an image that is a link. When I click on it it sends me somewhere and then if I click back to return on that page that image has a 1px dotted blue border around itself. Furthermore, if I click on it and hold that border becomes red. This is really bad looking and I cannot find a way to delete that border.
I've tried with

a:visited {text-decoration: none}
a:active {text-decoration: none}

and with:

a:visited img{text-decoration: none}
a:active img{text-decoration: none}

with no effect.
By the way, this border does not appear in chrome.

Here is my css code regarded to that image:

#back_to_photos{
float:right;
position: relative;
margin-top:-238px;
margin-right: 40px;

}
a:visited {text-decoration: none}
a:active {text-decoration: none}

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

无所的.畏惧 2025-01-14 18:21:41

也许您的规则顺序有问题(不知道这些是您的示例中提到的唯一样式)。您可以尝试使用 !important 来“强制执行”:

a {text-decoration: none !important;}

希望它有所帮助。

Maybe is something wrong with the order of your rules (don't know these are the only styles mentioned in your example). What you could try is to 'force it' by using !important:

a {text-decoration: none !important;}

Hopes it helps.

悲凉≈ 2025-01-14 18:21:41

您的问题的解决方案是这样的:

a:link, a:link:hover { text-decoration: none }

希望它有帮助。

更多信息:squarefree.com/styles

the solution for your problem is this:

a:link, a:link:hover { text-decoration: none }

hope it helps.

more info on: squarefree.com/styles

羁客 2025-01-14 18:21:41

这篇文章介绍了如何执行此操作。也就是说,将 outline: 0; 放入 a:visited CSS 中应该可以解决问题。

text-decoration 仅处理下划线和删除线等内容。您遇到的问题是 outline 放置在单击/聚焦的链接周围,以告诉用户他们将鼠标悬停在上面。

请注意,如果您删除轮廓,则当用户使用键盘导航您的页面时,用户所在的位置将不明显。

This post describes how to do so. Namely, putting outline: 0; in your a:visited CSS should do the trick.

text-decoration only deals with things like underlines and strikethroughs. The problem you're encountering is with outline that is put around clicked/focused links to tell the user that's what they're hovering over.

Do note that if you remove the outline it won't be apparent where the user is if they're navigating your page with the keyboard.

无法言说的痛 2025-01-14 18:21:41

您想使用outline: none

但要小心,隐藏轮廓可能会导致可用性问题,尤其是对于那些使用键盘导航的用户。

You want to use outline: none.

Be careful though, hiding the outline can lead to usability issues, especially with those users who navigate with the keyboard.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文