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

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

The `dir` attribute on a `<meta>` element is set to an empty string, and `dir` only accepts `ltr`, `rtl` or `auto`.

`dir` is a global attribute, so `<meta>` may carry it. On a `<meta>` with human-readable `content`, such as a page description, it sets the direction of that text. An empty `dir=""` names no direction, so the validator rejects it. Remove the attribute if the text reads in the same direction as the page, or set `rtl`, `ltr` or `auto` if it doesn't.

Often nobody wrote that `dir` on purpose. A double quote inside the `content` value closes the attribute early, and the browser reads each word after it as a separate attribute with an empty value. If one of those words is "dir", you get this error, along with an "Attribute not allowed" error for each of the other words. A CMS or template that copies an excerpt into a `description` or `og:description` tag without escaping it produces exactly this. Write double quotes inside the value as `&quot;`, or strip them before printing the tag.

## Invalid example

```html
<meta name="description" content="Opening hours and contact details" dir="">
```

## Valid example

```html
<meta name="description" content="Opening hours and contact details">
```

## Invalid example with an unescaped quote

```html
<meta name="description" content="How the "auto" value of the dir attribute picks a text direction">
```

## Valid example with the quote escaped

```html
<meta name="description" content="How the &quot;auto&quot; value of the dir attribute picks a text direction">
```
