Skip to main content

HTML Guide

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

Spaces in the poster attribute value are not valid in URLs and must be percent-encoded as %20.

The poster attribute on the video element specifies an image to show until the user plays or seeks the video. Attribute values that represent URLs (such as in src, href, or poster) must use valid URI syntax, meaning spaces are not allowed. Spaces must be replaced with %20, or you can use a path that avoids spaces entirely.

Example — Incorrect:

<video controls poster="/img/video images/snapshot.png">
  <source src="/videos/sample.mp4" type="video/mp4">
</video>

Example — Fixed with percent-encoding:

<video controls poster="/img/video%20images/snapshot.png">
  <source src="/videos/sample.mp4" type="video/mp4">
</video>

Example — Fixed by removing spaces from the folder name:

<video controls poster="/img/video-images/snapshot.png">
  <source src="/videos/sample.mp4" type="video/mp4">
</video>

Always encode any space in URLs as %20 or avoid spaces in file and folder names.

Learn more:

Related W3C validator issues