How to take the blue color out of links by ultializing CSS?

Asked

Viewed 38,536 times

4

My teacher asked me to recreate the pages of G1, Globe Sport and Walmart. He wants the links "dead, so I use the <a href="#">. The problem is that there the contents of a turns blue, and the pages have links in various different colors.

What I want to do is get Blue out of the links, and leave the word that will turn link with the color she is already.

I’ve used the CSS text-decoration: none, but it didn’t. There’s some other way to solve this?

  • The simple thing would be to have already put the color in the links, and not in the "word that will become link". There may even be a reason for this, but in principle I see no sense coloring the element from the outside to have to patch the inside then.

  • Because it is not to have mouse effects on the page, and to play only with html and css, so when I started doing I was defining all the colors as they are on the original page, and I only had this doubt, after the pages are ready.

1 answer

13


In principle it is enough to inherit the colour:

a { color: inherit; } 

This will make the element have your father’s color (which is what I think you’re looking for).

But if it’s not that, then just assign colors:

/* link que ainda não foi visitado */
a:link {
   color: red;
}

/* link que foi visitado */
a:visited {
    color: green;
}

/* mouse over */
a:hover {
    color: #000000;
}

/* link selecionado */
a:active {
    color: blue;
}

From what I understand, you have different colors for different links, so just assign to the correct class a.<NOME DA CLASSE>:

/* link que ainda não foi visitado */
a.botao-vermelho:link {
   color: red;
}

//...
  • a:Hover, a:visited, a:Focus, a:active{ text-Decoration: None; color: inherit; }

  • After seeing the answers I managed to do exactly what I wanted with the code above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.