Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

An ID must not contain whitespace

The id attribute of an HTML element, used to identify the element when linking, scripting or styling, must be unique in the whole document and must not contain whitespace.

Technically, in HTML5, the value for an id attribute may contain any character, except whitespace characters. However, to avoid inadvertent errors, only ASCII letters, digits, _, and - should be used and the value for an id attribute should start with a letter.

Learn more:

Related W3C validator issues