Skip to main content

div

Trait div 

Source
pub trait div {
    const div: ElementBuilder<DivElement, (), ()>;
}
Expand description

Per-element trait carrying the element as an associated const on the shared html root, so html::#name resolves wherever this trait is in scope. Other vocabularies extend the same root the same way.

Required Associated Constants§

Source

const div: ElementBuilder<DivElement, (), ()>

Build a <div> element.

Part of the HTML namespace. Only works in HTML-compatible renderers

§Definition and Usage
  • The <div> tag defines a division or a section in an HTML document.
  • The <div> tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript.
  • The <div> tag is easily styled by using the class or id attribute.
  • Any sort of content can be put inside the <div> tag!

Note: By default, browsers always place a line break before and after the <div> element.

§References:

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§