Search code examples
cssgoogle-chromehyperlinkunderline

How can I remove the underline of a link in chrome using 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;
}

and

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

Solution

  • 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.

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