pub struct Section;Expand description
The <section> element - thematic grouping of content.
§Purpose
The <section> element represents a generic standalone section of a document,
which doesn’t have a more specific semantic element to represent it. Sections
should typically have a heading, and they group related content thematically.
§Content Categories
- Flow Content
- Sectioning Content
- Palpable Content
§Permitted Content Model
- Flow content
§Common Use Cases
- Thematic grouping of content (chapters, tabs in a tabbed interface)
- Different sections of an article or document
- Grouping related content with a heading
- Creating document outlines with hierarchical sections
§Key Attributes
- Global attributes only
§Example
<article>
<h1>The Complete Guide to Web Development</h1>
<section>
<h2>Introduction</h2>
<p>Web development encompasses...</p>
</section>
<section>
<h2>Frontend Technologies</h2>
<p>HTML, CSS, and JavaScript form...</p>
</section>
<section>
<h2>Backend Technologies</h2>
<p>Server-side programming...</p>
</section>
</article>§Accessibility
- Each section should have a heading for proper document outline
- Screen readers use sections to navigate content structure
§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Section
impl HtmlElement for Section
impl<T: FlowContent> CanContain<T> for Section
impl FlowContent for Section
impl PalpableContent for Section
impl SectioningContent for Section
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnwindSafe for Section
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more