Aside

Struct Aside 

Source
pub struct Aside;
Expand description

The <aside> element - tangentially related content.

§Purpose

The <aside> element represents content that is tangentially related to the content around it, which could be considered separate from that content. Such sections are often represented as sidebars or call-out boxes.

§Content Categories

  • Flow Content
  • Sectioning Content
  • Palpable Content

§Permitted Content Model

  • Flow content

§Common Use Cases

  • Sidebars with related links or content
  • Pull quotes or callouts
  • Advertising
  • Groups of nav elements (e.g., blogrolls, secondary navigation)
  • Related articles or “You might also like” sections

§Key Attributes

  • Global attributes only

§Example

<article>
  <h1>Climate Change Impact</h1>
  <p>Recent studies show...</p>
  <aside>
    <h2>Related Articles</h2>
    <ul>
      <li><a href="/renewable-energy">Renewable Energy</a></li>
      <li><a href="/carbon-footprint">Carbon Footprint</a></li>
    </ul>
  </aside>
</article>

§Accessibility

  • Screen readers identify <aside> as a complementary landmark
  • Content should be understandable even if aside is removed

§WHATWG Specification

Trait Implementations§

Source§

impl HtmlElement for Aside

Source§

const TAG: &'static str = "aside"

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: FlowContent> CanContain<T> for Aside

Source§

impl FlowContent for Aside

Source§

impl PalpableContent for Aside

Source§

impl SectioningContent for Aside

Auto Trait Implementations§

§

impl Freeze for Aside

§

impl RefUnwindSafe for Aside

§

impl Send for Aside

§

impl Sync for Aside

§

impl Unpin for Aside

§

impl UnwindSafe for Aside

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.