Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an HTML link that doesn't highlight?

Tags:

html

css

What I mean by that, is having a link without it highlighting purple/blue when you click it/don't click it.

like image 308
Anonymous the Great Avatar asked Jun 24 '10 21:06

Anonymous the Great


People also ask

How do I hide the color of a hyperlink in HTML?

Click on the menu command Format | Edit Styles | Link to show the Link Styles dialog. Type a new link style name, such as "Hyperlinks", and press OK. Set Underlining to None, and Text colour to None or Specified, as required.


4 Answers

You need to add some CSS styling using CSS pseudo-classes.

Here is an example showing CSS added to the head element in a style tag that changes all links to always be black. However, ideally CSS should be in an external file and for usability you probably want to give some indication that the text is a link.

<head>
    <style type="text/css">
       a:link {color: black;}      /* unvisited link */
       a:visited {color: black;}   /* visited link */
       a:hover {color: black;}     /* mouse over link */
       a:active {color: black;}    /* selected link */
    </style>
</head>

See:

  • W3 Schools Tutorial
  • Smashing Magazine Guide
  • Mozilla Documentation :link
  • Mozilla Documentation :visited
  • Mozilla Documentation :hover
  • Mozilla Documentation :active
like image 188
Adam Avatar answered Nov 15 '22 07:11

Adam


You can use the following css, either in a stylesheet or enclosed in <style> tags:

a {
   text-decoration: none;
} 
like image 39
Jack Marchetti Avatar answered Nov 15 '22 08:11

Jack Marchetti


Try this :-)

a:visited {
    color: black;
}
like image 22
Ben Everard Avatar answered Nov 15 '22 09:11

Ben Everard


If you want it for all your website you can set the style of your body, something like this:

body a
{
  color: #000000;
}
like image 36
alejandrobog Avatar answered Nov 15 '22 09:11

alejandrobog