Sup

Struct Sup 

Source
pub struct Sup;
Expand description

The <sup> element - superscript.

§Purpose

The <sup> element represents superscript text, which appears half a character above the normal line and is often rendered in a smaller font. Used for exponents, ordinal indicators, and footnote markers.

§Content Categories

  • Flow Content
  • Phrasing Content
  • Palpable Content

§Permitted Content Model

  • Phrasing content

§Common Use Cases

  • Mathematical exponents (x², 10³)
  • Ordinal indicators (1st, 2nd, 3rd)
  • Footnote or reference markers
  • Trademark symbols (™, ®)

§Key Attributes

  • Global attributes only

§Example

<p>Einstein's equation: E = mc<sup>2</sup></p>
<p>Area of a square: side<sup>2</sup></p>
<p>On the 21<sup>st</sup> of March...</p>
<p>Copyright<sup>&copy;</sup> 2024</p>

§WHATWG Specification

Trait Implementations§

Source§

impl HtmlElement for Sup

Source§

const TAG: &'static str = "sup"

The HTML tag name (e.g., “div”, “span”, “img”).
Source§

const VOID: bool = false

Whether this is a void element (self-closing, no children allowed).
Source§

impl<T: PhrasingContent> CanContain<T> for Sup

Source§

impl CanContain<Text> for Sup

Source§

impl FlowContent for Sup

Source§

impl PalpableContent for Sup

Source§

impl PhrasingContent for Sup

Auto Trait Implementations§

§

impl Freeze for Sup

§

impl RefUnwindSafe for Sup

§

impl Send for Sup

§

impl Sync for Sup

§

impl Unpin for Sup

§

impl UnwindSafe for Sup

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.