Some of my class attributes are generated by PHP, so sometimes there are extra whitespaces in HTML output, in example:
class=" hey joe "
As we can see there are:
– empty first char
– two empty chars between hey and joe
– empty last char
May it cause some problems for browsers, web crawlers or other problems?
There is no problem with this. The class attribute accepts any number of classes separated by whitespaces. Trailing and leading whitespaces are not significant here.
Please see White Space handling in attribute values and Attribute-Value Normalization for authoritative details.