As per MDN attribute selector in css has the following syntax:
div[attr="actualValue"]
Or like this example:
<div class="test"></div>
div[class="test"]
But I noticed that the quotes around the test
are not needed as:
div[class=test]
Example:
div[class=test] {
background: #6ea7b2;
}
<div class="test">I am a div</div>
Why is this? Does w3c spec allow attribute selection without quotes around the value?