Combining 2 nth-of-types attributes together. Is this possble, or no?

Is something like this possible to do or no?

.nav a:nth-of-type(10), a:nth-of-type(10) {
  border: 3px solid #0059dd;
  background: rgba(255, 170, 0, 0.5);
}
.nav a:nth-of-type(10), 
a:nth-of-type(10) {
  border: 3px solid #0059dd;
  background: rgba(255, 170, 0, 0.5);
}

Yes

1 Like

I tried doing it here.

.wrape .nav a:nth-of-type(11),
a:nth-of-type(12) {
  border: 3px solid #0059dd;
  background: red;
}

I am going to ASSume that there is a point to your presentation or an unexpressed question that (1) I am supposed to find and (2) answer.

.wrape .nav a:nth-of-type(11),
.wrape .nav a:nth-of-type(12) {
    border: 3px solid #0059dd;
    background: red;
}

The secret word is “specificity”.

Each selector must be a complete full selector.
Comma’s are simply selector separators. They do not allow one to omit the leading part(s) of subsequent selectors.

3 Likes

oh, ok, now I know why it wasn’t working before. Because I wasn’t putting the code in right.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.