Dl

Struct Dl 

Source
pub struct Dl;
Expand description

The <dl> element - description list.

§Purpose

The <dl> element represents an association list consisting of zero or more name-value groups (term-description pairs). Common uses include glossaries, metadata, or key-value pairs.

§Content Categories

  • Flow Content
  • Palpable Content (if it has at least one name-value pair)

§Permitted Content Model

  • Zero or more groups of one or more <dt> elements followed by one or more <dd> elements
  • Optionally intermixed with <script> and <template> elements
  • Can also contain <div> elements wrapping <dt> and <dd> groups

§Common Use Cases

  • Glossaries and definitions
  • Metadata or property lists
  • FAQ sections (question-answer pairs)
  • Product specifications

§Key Attributes

  • Global attributes only

§Example

<dl>
  <dt>HTML</dt>
  <dd>HyperText Markup Language</dd>
   
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
   
  <dt>JavaScript</dt>
  <dt>JS</dt>
  <dd>A programming language for web browsers</dd>
</dl>

§Accessibility

  • Screen readers may announce term-description relationships

§WHATWG Specification

Trait Implementations§

Source§

impl HtmlElement for Dl

Source§

const TAG: &'static str = "dl"

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 CanContain<Dd> for Dl

Source§

impl CanContain<Div> for Dl

Source§

impl CanContain<Dt> for Dl

Source§

impl CanContain<Script> for Dl

Source§

impl CanContain<Template> for Dl

Source§

impl FlowContent for Dl

Source§

impl PalpableContent for Dl

Auto Trait Implementations§

§

impl Freeze for Dl

§

impl RefUnwindSafe for Dl

§

impl Send for Dl

§

impl Sync for Dl

§

impl Unpin for Dl

§

impl UnwindSafe for Dl

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.