About This HTML Issue
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
<span dir="">Some text</span>
Valid Examples
<!-- 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>
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.