a: 访问过的 {textdecoration: none} 在 Firefox 中不起作用
我有一个图像,它是一个链接。当我点击它时,它会将我发送到某个地方,然后如果我点击返回返回到该页面,则该图像周围有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
也许您的规则顺序有问题(不知道这些是您的示例中提到的唯一样式)。您可以尝试使用 !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:
Hopes it helps.
您的问题的解决方案是这样的:
希望它有帮助。
更多信息:squarefree.com/styles
the solution for your problem is this:
hope it helps.
more info on: squarefree.com/styles
这篇文章介绍了如何执行此操作。也就是说,将
outline: 0;
放入a:visited
CSS 中应该可以解决问题。text-decoration
仅处理下划线和删除线等内容。您遇到的问题是outline
放置在单击/聚焦的链接周围,以告诉用户他们将鼠标悬停在上面。请注意,如果您删除轮廓,则当用户使用键盘导航您的页面时,用户所在的位置将不明显。
This post describes how to do so. Namely, putting
outline: 0;
in youra:visited
CSS should do the trick.text-decoration
only deals with things like underlines and strikethroughs. The problem you're encountering is withoutline
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.
您想使用
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.