Class Hr


@Marshalled(typeName="hr") public class Hr extends HtmlElementVoid<Hr>
DTO for an HTML <hr> element.

The hr element represents a paragraph-level thematic break, such as a scene change in a story, or a transition to another topic within a section of a reference book. It is used to create a horizontal rule or line that visually separates content sections. The hr element is a void element that does not contain any content and is typically rendered as a horizontal line across the page.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple horizontal rule Hr simple = hr(); // HR with styling Hr styled = hr() .class_("section-divider") .style("border: 2px solid #ccc; margin: 20px 0;"); // HR with ID Hr withId = hr() .id("content-break"); // HR with styling Hr styled2 = hr() .style("border: none; border-top: 1px dashed #999; margin: 30px 0;"); // HR with multiple attributes Hr complex = hr() .class_("fancy-divider") .style("border: none; height: 3px; background: linear-gradient(to right, #ff6b6b, #4ecdc4); margin: 40px 0;"); // HR with accessibility Hr accessible = hr() .title("Section break") .style("border: 1px solid #ddd; margin: 25px 0;"); // HR with custom styling Hr custom = hr() .class_("custom-hr") .style("border: none; height: 1px; background-color: #e0e0e0; margin: 15px 0;");

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

See Also:
  • Constructor Details

    • Hr

      public Hr()
      Creates an empty Hr element.