Skip to main content
HTML Validation

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

About This HTML Issue

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.

Last reviewed: May 16, 2025

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.