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.
HTML BDO Generator Options
- Type sets the required
dirattribute toltrorrtl. - Text supplies the content whose rendering direction is overridden.
- Spellcheck explicitly sets
spellcheck="true"orspellcheck="false"for the generated element.
Text is escaped in the generated markup, so characters such as < and & remain text rather than becoming nested HTML.
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:
- Create an
HTMLDocument. - Create the
bdoelement withCreateElement(). - Set
dirandspellcheck, then assign the entered text throughTextContent. - Add the element with
AppendChild()and writebdo.htmlwithSave().
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.
Other Supported HTML Generators
Create and preview markup for other common HTML elements.