sycamore::web::tags

Function div

pub fn div() -> HtmlDiv
Expand description

Create a <div> element.

The <div> HTML element is the generic container for flow content. It has no effect on the content or layout until styled in some way using CSS (e.g. styling is directly applied to it, or some kind of layout model like Flexbox is applied to its parent element).

As a “pure” container, the <div> element does not inherently represent anything. Instead, it’s used to group content so it can be easily styled using the class or id attributes, marking a section of a document as being written in a different language (using the lang attribute), and so on.

§Usage notes

The <div> element should be used only when no other semantic element (such as <article> or <nav>) is appropriate.