pub struct Meta;Expand description
The <meta> element - document metadata.
§Purpose
The <meta> element represents various kinds of metadata that cannot be represented
by other HTML meta-related elements (<title>, <base>, <link>, <style>).
Used for character encoding, viewport settings, SEO, and social media metadata.
§Content Categories
- Metadata Content
§Permitted Content Model
- None (void element)
§Common Use Cases
- Setting character encoding (
charset) - Configuring viewport for responsive design
- Providing page description for search engines
- Adding Open Graph tags for social media sharing
- Setting HTTP headers via
http-equiv
§Key Attributes
charset: Character encoding declaration (e.g.,"UTF-8")name: Metadata name (e.g.,"viewport","description","author")content: Metadata value (used withnameorhttp-equiv)http-equiv: Pragma directive (e.g.,"refresh","content-security-policy")
§Example
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A comprehensive guide to HTML5">
<meta property="og:title" content="HTML5 Guide">
<meta property="og:image" content="https://example.com/image.png">
</head>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Meta
impl HtmlElement for Meta
impl CanContain<Meta> for Head
impl MetadataContent for Meta
Auto Trait Implementations§
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl Send for Meta
impl Sync for Meta
impl Unpin for Meta
impl UnwindSafe for Meta
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