Create an HTML <bdo> Element Online

The HTML BDO Generator creates a <bdo> element that overrides the bidirectional rendering of its text. Select ltr or rtl, enter the text, and inspect the updated preview, HTML output, and C# output.

Use <bdo> only when the text must render in a direction different from the surrounding content and the direction is known. Its required dir value is limited to ltr or rtl.



Create an HTML <bdo> Element in C#

The C# panel shows how to create the configured element with Aspose.HTML for .NET . The generated code follows this workflow:

  1. Create an HTMLDocument .
  2. Create the bdo element with CreateElement() .
  3. Set dir and spellcheck, then assign the entered text through TextContent .
  4. Add the element with AppendChild() and write bdo.html with Save() .

Choose the direction and enter the text before copying the updated C# code.


HTML BDO Generator FAQ

1. What does the HTML <bdo> element do?

The <bdo> element overrides the Unicode bidirectional rendering algorithm for its contents. It forces that text segment to render left-to-right or right-to-left according to its dir attribute.

2. Is the dir attribute required on <bdo>?

Yes. A <bdo> element must have dir="ltr" or dir="rtl"; auto is not valid for this element because an override requires an explicit direction.

3. When should I use <bdo> instead of the global dir attribute?

Use <bdo> for an exceptional text segment whose display order must be forcibly overridden. For ordinary document direction or inherited language direction, set dir on an appropriate container instead.

4. How is <bdo> different from <bdi>?

The <bdo> element forces a chosen direction on its contents. The <bdi> element isolates text of unknown direction from surrounding text without forcing that content to render as ltr or rtl.

5. Does changing direction translate or reverse the text characters?

No. The element changes bidirectional rendering, not the underlying characters or language. The copied text remains the same in the document source.


Get Started with Aspose.HTML for .NET API

Install Aspose.HTML for .NET from NuGet with the .NET CLI:

dotnet add package Aspose.HTML

You can also use the NuGet Package Manager UI or run Install-Package Aspose.HTML in the Package Manager Console. See the installation guide for setup details, or request a temporary license to evaluate the API without evaluation limitations.