# Bad value “” for attribute “dir” on element “span”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-for-attribute-dir-on-element-span
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `dir` attribute cannot be an empty string — it must be one of the allowed values: `ltr`, `rtl`, or `auto`.

The `dir` attribute specifies the text directionality of an element's content. It is a global attribute, meaning it can be used on any HTML element. When you set `dir=""`, the validator rejects it because an empty string doesn't convey any meaningful direction.

If you don't need to specify a direction, simply remove the `dir` attribute entirely. The element will naturally inherit the directionality from its parent. If you want the browser to determine the direction based on the text content, use `dir="auto"`.

## Invalid Example

```html
<span dir="">Some text</span>
```

## Valid Examples

```html
<!-- Remove the attribute to inherit direction from the parent -->
<span>Some text</span>

<!-- Or explicitly set a valid direction -->
<span dir="ltr">Some text</span>

<!-- Or let the browser decide based on content -->
<span dir="auto">Some text</span>
```
