Skip to main content

HTML Guide

Bad value “X” for attribute “src” on element “img”: Illegal character in path segment: space is not allowed.

Space characters are not allowed in src attributes. Instead, they should be converted to %20. In this example, the first line is invalid and the second is valid:

<img src="https://example.com/?s=some term" alt="description" />
<img src="https://example.com/?s=some%20term" alt="description" />

Related W3C validator issues