pub struct Html;Expand description
The <html> element - the root element of an HTML document.
§Purpose
The <html> element represents the root (top-level element) of an HTML document.
All other elements must be descendants of this element. It establishes the document
as an HTML document and provides a container for the entire page content.
§Content Categories
- None (root element, not categorized)
§Permitted Content Model
- One
<head>element followed by one<body>element.
§Common Use Cases
- Root container for every HTML document
- Container for setting document-wide attributes like
lang - Container for document-level metadata via
<head>
§Key Attributes
lang: Specifies the primary language of the document (e.g.,"en","es","fr")- Global attributes
§Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document Title</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Html
impl HtmlElement for Html
impl CanContain<Body> for Html
impl CanContain<Head> for Html
Auto Trait Implementations§
impl Freeze for Html
impl RefUnwindSafe for Html
impl Send for Html
impl Sync for Html
impl Unpin for Html
impl UnwindSafe for Html
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