1

Here's my CSS:

* {
    border: none;
}

Now, I thought an asterisk means everything, apparently it didn't for ::-moz-focus-inner, which means I have to do it like this:

* {
    border: none;
}

*::-moz-focus-inner {
    border: none;
}

Why is this?

  • 1
    That's because you're using a pseudoelement... `*` selects all elements, not including pseudoelements. – Andrew Li Aug 07 '17 at 18:12

1 Answers1

1

As commented by @Andrew Li, the universal * selector selects only elements. It's a simple element selector targets only actual elements on the page. Here's a related question with great nuggets of information in the answers and comments.

One answer points to the universal selector specification (emphasis mine):

The universal selector, written "*", matches the name of any element type. It matches any single element in the document tree.

That last bit excludes pseudo elements like ::-moz-focus-inner, :before, and :after that are not in the document tree.


If you want to optimize your code a little, you could move towards something like this:

*,
*::-moz-focus-inner {
    border: none;
}
Ted Goas
  • 7,051
  • 1
  • 35
  • 42