3

Without grouping we could do:

.footer_content a:link {
    color: #FFFFFF;
}
.footer_content a:visited {
    color: #FFFFFF;
}

With grouping:

.footer_content a:link, .footer_content a:visited {
    color: #FFFFFF;
}

is there a way to define the css selector to get rid of the extra .footer_content declaration that does the same thing? Something that would looking a bit like this:

.footer_content (a:link, a:visited) {
    color: #FFFFFF;
}

2 Answers 2

4

There currently is not a universally supported way of achieving that.

However, the experimental :any() selector would make that possible, if it gets implemented and standardised. It is not supported in any browser but the latest Firefox nightlies yet.

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

Comments

2

You can achieve something kinda similar with Sass, which "compiles down" to CSS.

In Sass you would use nesting, like so:

.footer_content {
  a:link, a:visited {
    color: #FFFFFF;
  }
}

1 Comment

this is convenient, I wish it was standard css!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.