Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<bdi>

Isolates text of unknown writing direction so it does not scramble the neighbouring characters.

Syntax

<bdi>user text</bdi>

Examples

An Arabic user name next to numbers:

<p>Without bdi: إيان: 3 posts</p>
<p>With bdi: <bdi>إيان</bdi>: 3 posts</p>

Notes

Use it when the page shows user text in any language — for example, names in a comment list. If the direction is known in advance, the dir attribute is enough.

See also

  • dir — The writing direction: left to right or right to left.
  • lang — The language of an element's content.

In the tutorial

  • Special characters — HTML entities — how to show reserved signs on a page, the non-breaking space, the copyright sign, the em dash and any character by its number.

Thanks for reading!

Donate to the site — we work hard for you.