Class Article


@Bean(typeName="article") public class Article extends HtmlElementMixed
DTO for an HTML <article> element.

The article element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable. It is used for content that could stand alone, such as blog posts, news articles, forum posts, or other independent pieces of content. Each article should have its own heading structure and can contain other semantic elements.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple blog post article Article blogPost = article( header( h1("How to Use HTML5 Semantic Elements"), p("Published on ", time("2024-01-15", "January 15, 2024")) ), p("HTML5 introduced several semantic elements that help structure content..."), footer( p("Author: John Doe"), address("Contact: john@example.com") ) ); // News article Article newsArticle = article( header( h1("Breaking: New Technology Released"), p("By Jane Smith, Technology Reporter") ), p("A revolutionary new technology was announced today..."), section( h2("Technical Details"), p("The technology works by...") ) ); // Forum post Article forumPost = article( header( h3("Question about CSS Grid"), p("Posted by ", strong("user123"), " on ", time("2024-01-14", "yesterday")) ), p("I'm having trouble with CSS Grid layout..."), footer( p("Tags: ", a("/tag/css", "CSS"), ", ", a("/tag/grid", "Grid")) ) )._class("forum-post"); // Product review Article review = article( header( h1("Review: Amazing Widget Pro"), p("Rating: ", strong("5/5 stars")) ), p("After using the Amazing Widget Pro for a month..."), section( h2("Pros"), ul( li("Easy to use"), li("Great performance"), li("Excellent support") ) ) ); // Article with multiple sections Article multiSection = article( header(h1("Complete Guide to Web Development")), section( h2("Introduction"), p("Web development encompasses many technologies...") ), section( h2("Frontend Development"), p("Frontend development focuses on...") ), section( h2("Backend Development"), p("Backend development handles...") ) );

The following convenience methods are provided for constructing instances of this bean:

See Also: