pub struct Body;Expand description
The <body> element - document body.
§Purpose
The <body> element represents the main content of an HTML document.
There can be only one <body> element per document, and it contains all
the visible content that is displayed to users.
§Content Categories
- Sectioning Root
§Permitted Content Model
- Flow content (most visible HTML elements)
§Common Use Cases
- Container for all visible page content
- Structuring the main layout of a webpage
- Applying document-wide styles via CSS
- Attaching document-level event handlers
§Key Attributes
- Event handler attributes (
onload,onunload,onbeforeunload, etc.) - Global attributes
§Example
<body>
<header>
<h1>My Website</h1>
<nav>...</nav>
</header>
<main>
<article>...</article>
</main>
<footer>
<p>© 2024 My Website</p>
</footer>
</body>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Body
impl HtmlElement for Body
impl CanContain<Body> for Html
impl<T: FlowContent> CanContain<T> for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnwindSafe for Body
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