What are CSS attributes selectors and what is their syntax?
Syntax: selector[attribute] {}
The [attribute] selector is used to select elements with a specified attribute.
It is possible to style HTML elements that have:
In the second case, the operator can be more complex than just a simple equal sign:
What is the difference between a.btn and a[class=”btn”]?
The selector[] syntax is an attribute selector. This will select any a tag with class=”btn”. However, it will not select a tag which has class=”btn btn_red”, for example (whereas a.btn would). It only exactly matches that attribute.