开发者

White spaces in HTML attributes

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 开发者_如何学JAVAchars 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜