<bdi>...</bdi>

HTML4 HTML5

Isolates a span of text (Bi-Directional Isolation) that might be formatted in a different direction from other text outside it. Particularly useful for dynamic content (such as usernames or comments) where text direction (LTR or RTL) is unknown ahead of time.

Both opening and closing tags are required.

Attributes: Mostly global attributes are used (including dir with values ltr, rtl, or default auto).

Example

Code:

<ul style="list-style-type: none; padding-left: 0;"> <li>User <bdi>Jan Kowalski</bdi>: 100 points</li> <li>User <bdi>إبراهم</bdi>: 90 points</li> </ul>

The browser will interpret this code as follows:

  • User Jan Kowalski: 100 points
  • User إبراهم: 90 points