css - CSS3 selector matching value beginning with "[attribute^=value]" is not matching value that has space(s) after quotation -
the
div[class^="test"]
selector not match element in markup if element
class=" test-something"
(the intended selector had been generated on backend.)
the
div[class^=" test"]
is not option.
any suggestions?
what did there ^=
is:
'begins with..'
div[class^="test"] { }
which work on this:
<div class="test and-some-class"></div> <!-- if first string in class matches "test" --> <!-- so, class=" test something-else" won't work
you have use css selector:
'contains..'
div[class*="test"] { }
which work on
<div class="class test something-else"></div> <!-- class name can anything. "test" can anywhere -->
reference
Comments
Post a Comment