I want to make a CSS selector for a class which starts with a whitespace, but I don't know how. For example: <table class=" example">…</table>
.
Any leading or trailing spaces in the value of a class attribute are meaningless for targeting purposes. This: class=" example"
is equivalent to this: class="example"
.
There is no need for a special selector that factors in the space.
From the HTML 5 spec:
A string containing a set of space-separated tokens may have leading or trailing space characters.
Space characters are necessary, however, for separating multiple values in a class attribute.
The attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.
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