I encountered a css selector in a file like this:
#contactDetails ul li a, a[href^=tel] {....}
The CSS class Selector The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the class name.
href carrot CSS selector is used to target “a” tag having href value and starting with the keyword. In this case, This will change color of all “a” tag having external link.
C^ret is an online tool that helps you create a caret (or an arrow symbol) in pure CSS. The caret can be pointing in any direction, the border width, the color can be changed and the code is generated as you move the slider.
The symbols CSS descriptor is used to specify the symbols that the specified counter system will use to construct counter representations.
The circumflex character “^” as such has no defined meaning in CSS. The two-character operator “^=” can be used in attribute selectors. Generally, [attr^=val]
refers to those elements that have the attribute attr
with a value that starts with val
.
Thus, a[href^=tel]
refers to such a
elements that have the attribute href
with a value that starts with tel
. It is probably meant to distinguish telephone number links from other links; it’s not quite adequate for that, since the selector also matches e.g. <a href="tel.html">...</a>
but it is probably meant to match only links with tel:
as the protocol part. So a[href^="tel:"]
would be safer.
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