According to the MDN attribute selector in CSS, it has the following syntax:
div[attr="actualValue"]
For example:
<div class="test"></div>
div[class="test"]
However, I have observed that the quotes around the test
are not necessary as shown here:
div[class=test]
For instance:
div[class=test] {
background: #6ea7b2;
}
<div class="test">I am a div</div>
Why is this so? Does the W3C specification allow attribute selection without quotes around the value?