Class Html


@Marshalled(typeName="html") public class Html extends HtmlElementContainer<Html>
DTO for an HTML <html> element.

The html element represents the root of an HTML document. It contains all other HTML elements and serves as the top-level container for the entire document. The lang attribute is commonly used to specify the primary language of the document for accessibility and SEO purposes.

Examples:

// Basic HTML document structure Html html1 = html( head( title("My Web Page"), meta().charset("utf-8") ), body("Hello, World!") ).lang("en"); // HTML with manifest for offline support Html html2 = html( head( title("Offline App") ), body("This app works offline!") ).lang("en").manifest("app.manifest"); // HTML with custom attributes Html html3 = html( head( title("Página en Español") ), body("¡Hola, Mundo!") ).lang("es").class_("no-js");

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

See Also:
  • Constructor Details

    • Html

      public Html()
      Creates an empty Html element.
    • Html

      public Html(Object... children)
      Creates an Html element with the specified child nodes.
      Parameters:
      children - The child nodes. Must not be null.
  • Method Details

    • manifest

      public Html manifest(String value)
      manifest attribute.

      Specifies the URL of the application cache manifest file. This enables offline functionality by allowing the browser to cache resources for offline use.

      The manifest file should be a text file that lists resources to be cached.

      Parameters:
      value - The URL of the application cache manifest file. Can be null to unset the attribute.
      Returns:
      This object.