0

I have in my CSS:

body
{
    font-size: 0.87em;
    font-family: Calibri, Arial, Georgia, Verdana, Tahoma, Microsoft Sans Serif;
    margin: 0;
    padding: 0;
    color: #666666;
}

a:link
{
    color: rgb(124,71,111);
    text-decoration: underline;
}
a:visited
{
    color: rgb(41, 12, 36);
}
a:hover
{
    color: rgb(91,25,79);
    text-decoration: none;
}
a:active
{
    color: #AB6D9C;
}

the question is to the latter tag ".remove-linkcolor"

.remove-linkcolor
{

}

I would like the links to 'a' that is associated with the class '.remove-linkcolor' the following attributes are changed:

  1. The color is the same color of normal text How to avoid duplication of code and put the same color of another tag?
  2. Remove effects of active, hover normally would, but to continue as a link, so if you click the User, the same is executed.

1 Answer 1

1

Not sure I understand your question 2. However, I think this is the answer you need:

The only way to remove duplication of code in CSS is through combined selectors, something like:

body {
  font-size: 0.87em;
  font-family: Calibri, Arial, Georgia, Verdana, Tahoma, Microsoft Sans Serif;
  margin: 0;
  padding: 0;
}

body, .remove-linkcolor {
  color: #666666;
}

But then you end up repeating the selector, often. The only other way is not to do CSS: use SASS or similar CSS compiler.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.