I found the following definition in a CSS stylesheet :
*|*:link {color:#ff00ff;}
What's the use of the |? Is it some sort of CSS Hack?
A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS property values inside the rule applied to them.
signifies a class name while the hash ( # ) signifies an element with a specific id attribute. The class will apply to any element decorated with that particular class, while the # style will only apply to the element with that particular id.
In CSS, pattern matching rules determine which style rules apply to elements in the document tree. These patterns, called selectors, may range from simple element names to rich contextual patterns. If all conditions in the pattern are true for a certain element, the selector matches the element.
It separates namespace and element name.
Unless a default namespace has been defined, *|*:link
is a complicated way of writing *:link
or just :link
.
In an XML document, you could have the following:
<el xmlns="http://name/space" /> <style> @namespace namespace_example url(http://name/space); namespace_example|el {background: red;} </style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With