Class Li


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

The li element represents a list item. It is used to mark up individual items within a list, such as items in an unordered list (ul) or ordered list (ol). The li element can contain any flow content and is typically rendered with a bullet point (for ul) or a number (for ol) depending on the parent list type. The li element is essential for creating structured lists in HTML documents.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple list item Li simple = li("First item"); // Li with styling Li styled = li("Styled list item") ._class("list-item"); // Li with complex content Li complex = li( "Item with ", strong("bold text"), " and ", em("italic text") ); // Li with ID Li withId = li("List item with ID") .id("list-item-1"); // Li with styling Li styled2 = li("Custom styled list item") .style("color: #666; margin: 5px 0;"); // Li with multiple elements Li multiple = li( "Step 1: ", span("Complete the form")._class("step-title"), " ", small("(Required)") ); // Li with links Li withLinks = li( "Visit ", a("/help", "help page"), " for assistance" );

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

See Also:
  • Constructor Details

    • Li

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

      public Li(Object... children)
      Creates an Li element with the specified child nodes.
      Parameters:
      children - The child nodes.
  • Method Details