pub struct Article;Expand description
The <article> element - self-contained composition.
§Purpose
The <article> element represents a self-contained composition in a document,
page, application, or site, which is intended to be independently distributable
or reusable (e.g., in syndication). Examples include blog posts, news articles,
forum posts, product cards, user comments, and interactive widgets.
§Content Categories
- Flow Content
- Sectioning Content
- Palpable Content
§Permitted Content Model
- Flow content
§Common Use Cases
- Blog posts and news articles
- Forum or comment posts
- Product cards in e-commerce sites
- Independently distributable widgets
- User-submitted content
§Key Attributes
- Global attributes only
§Example
<article>
<header>
<h2>Understanding HTML5 Semantics</h2>
<p>Posted on <time datetime="2024-01-15">January 15, 2024</time></p>
</header>
<p>Semantic HTML elements provide meaning to web content...</p>
<footer>
<p>Written by Jane Doe</p>
</footer>
</article>§Accessibility
- Screen readers may announce article boundaries
- Consider using
<h1>-<h6>for article headings - Each article should be independently understandable
§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Article
impl HtmlElement for Article
impl<T: FlowContent> CanContain<T> for Article
impl FlowContent for Article
impl PalpableContent for Article
impl SectioningContent for Article
Auto Trait Implementations§
impl Freeze for Article
impl RefUnwindSafe for Article
impl Send for Article
impl Sync for Article
impl Unpin for Article
impl UnwindSafe for Article
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