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

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-poster-on-element-video-illegal-character-in-path-segment-square-bracket-is-not-allowed
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Square brackets are not valid characters in a URL path segment and must be percent-encoded in the `poster` attribute of a `<video>` element.

The `poster` attribute accepts a valid URL that points to an image displayed while the video is not playing or until the first frame loads. URLs follow RFC 3986, which restricts the characters allowed in path segments. Square brackets (`[` and `]`) are reserved characters that are only permitted in the host component of a URL (for IPv6 addresses). When they appear in a path, query, or fragment component, they must be percent-encoded as `%5B` for `[` and `%5D` for `]`.

This applies to any HTML attribute that expects a URL, not just `poster`. The same rule covers `src`, `href`, `action`, and similar attributes.

## Invalid example

```html
<video poster="/images/thumbnail[1].jpg" controls>
  <source src="video.mp4" type="video/mp4">
</video>
```

## Fixed example

Replace `[` with `%5B` and `]` with `%5D`:

```html
<video poster="/images/thumbnail%5B1%5D.jpg" controls>
  <source src="video.mp4" type="video/mp4">
</video>
```

If you control the file names on the server, renaming the file to avoid square brackets entirely is a simpler long term fix:

```html
<video poster="/images/thumbnail-1.jpg" controls>
  <source src="video.mp4" type="video/mp4">
</video>
```
