Is the vertical bar (|) valid CSS, or Firefox-spec

2019-04-20 22:15发布

问题:

I noticed this rule in Firebug:

*|*:link {
  color:#0000EE;
}

I'm not sure that I've ever seen the vertical bar (|) before. It's in the about:PreferenceStyleSheet so it may be Firefox-specific.

What does it mean? Any link to a reference? I thought possibly that the vertical bar was an "OR", but that's the comma in CSS.

回答1:

The | selector is the namespace selector. The part before the | is the namespace and the part after the | the selector.

So *|*:link means to match any element in any namespace that is a link.