Class Br


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

The br element represents a line break. It is used to create a line break in text content, forcing the text that follows it to start on a new line. The br element is a void element that does not contain any content and is typically used within text content to create line breaks where needed, such as in addresses, poetry, or other formatted text.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple line break Br simple = br(); // Address with line breaks P address = p( "John Doe", br(), "123 Main Street", br(), "Anytown, ST 12345" ); // Poetry with line breaks P poetry = p( "Roses are red,", br(), "Violets are blue,", br(), "Sugar is sweet,", br(), "And so are you." ); // Contact information P contact = p( "Phone: (555) 123-4567", br(), "Email: john@example.com", br(), "Website: www.example.com" ); // Styled line break Br styled = br() .class_("line-break") .style("margin: 10px 0;"); // Multiple line breaks P multiple = p( "First line", br(), br(), "Third line (with extra space)" ); // Line break in a list Li listItem = li( "Item 1", br(), "Additional details for item 1" );

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

See Also:
  • Constructor Details

    • Br

      public Br()
      Creates an empty Br element.