如何使用 CSS 删除 chrome 中链接的下划线? [英] How can I remove the underline of a link in chrome using CSS?

查看:21
本文介绍了如何使用 CSS 删除 chrome 中链接的下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(它适用于 FF)如何使用 CSS 删除已访问链接的下划线?我试过了:

(it works in FF) How can I, using CSS, remove the underline of a visited link? I have tried:

a:visited {
    color: rgb(255, 255, 255);
    text-decoration: none !important;
}

a:visited {
    color: rgb(255, 255, 255);
    text-decoration: none;
}

推荐答案

在大多数基于 webkit 的浏览器(如 Chrome)中,您可以应用到 :visited 链接的唯一 CSS 属性是 color.这是为了防止历史窃取.此外,您无法通过 JavaScript 确定链接的 color CSS 属性的值.参见 https://bugs.webkit.org/show_bug.cgi?id=24300 了解详情.

The only CSS property you can apply on :visited links in most webkit-based browsers (like Chrome) is color. This is to prevent history stealing. Also, you can't determine the value of the color CSS property of links from JavaScript. See https://bugs.webkit.org/show_bug.cgi?id=24300 for details.

但是,您可以使用 a{text-decoration: none;} 更改所有链接的样式.这是整个事件的演示.

You can, however, change the style of all links with a{text-decoration: none;}. Here's a demo of the whole affair.

这篇关于如何使用 CSS 删除 chrome 中链接的下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆