pub struct Sub;Expand description
The <sub> element - subscript.
§Purpose
The <sub> element represents subscript text, which appears half a character below
the normal line and is often rendered in a smaller font. Used for mathematical,
chemical, or typographical notations.
§Content Categories
- Flow Content
- Phrasing Content
- Palpable Content
§Permitted Content Model
- Phrasing content
§Common Use Cases
- Chemical formulas (H₂O)
- Mathematical subscripts (xᵢ, aₙ)
- Footnote references
- Typographic conventions
§Key Attributes
- Global attributes only
§Example
<p>The chemical formula for water is H<sub>2</sub>O.</p>
<p>The variable x<sub>i</sub> represents the i-th element.</p>
<p>CO<sub>2</sub> emissions have increased.</p>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Sub
impl HtmlElement for Sub
impl<T: PhrasingContent> CanContain<T> for Sub
impl CanContain<Text> for Sub
impl FlowContent for Sub
impl PalpableContent for Sub
impl PhrasingContent for Sub
Auto Trait Implementations§
impl Freeze for Sub
impl RefUnwindSafe for Sub
impl Send for Sub
impl Sync for Sub
impl Unpin for Sub
impl UnwindSafe for Sub
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