pub struct Bdi;Expand description
The <bdi> element - bidirectional isolate.
§Purpose
The <bdi> element isolates a span of text that might be formatted in a different
direction from other text around it. It’s used when embedding user-generated content
or database values where the text direction is unknown.
§Content Categories
- Flow Content
- Phrasing Content
- Palpable Content
§Permitted Content Model
- Phrasing content
§Common Use Cases
- User-generated content (usernames, comments)
- Database values with unknown text direction
- Mixing left-to-right and right-to-left text
- Product names or IDs that may contain RTL characters
§Key Attributes
- Global attributes only (particularly
dir)
§Example
<p>User <bdi>إيان</bdi> posted: "Hello world"</p>
<ul>
<li>User <bdi>jdoe</bdi>: 60 points</li>
<li>User <bdi>مستخدم123</bdi>: 50 points</li>
</ul>§Accessibility
- Prevents text direction issues in screen readers
- Maintains correct reading order
§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Bdi
impl HtmlElement for Bdi
impl<T: PhrasingContent> CanContain<T> for Bdi
impl CanContain<Text> for Bdi
impl FlowContent for Bdi
impl PalpableContent for Bdi
impl PhrasingContent for Bdi
Auto Trait Implementations§
impl Freeze for Bdi
impl RefUnwindSafe for Bdi
impl Send for Bdi
impl Sync for Bdi
impl Unpin for Bdi
impl UnwindSafe for Bdi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more