Class Span


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

The span element is a generic inline container for phrasing content. It has no inherent meaning and is typically used to group inline elements for styling purposes or to apply attributes to a portion of text. The span element is commonly used with CSS to apply styles to specific portions of text or to mark up text for JavaScript manipulation.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Text with highlighted portion Span highlight = span("This is highlighted text") ._class("highlight"); // Text with multiple styled portions Span styled = span( "Normal text ", span("bold text")._class("bold"), " and ", span("italic text")._class("italic") ); // Text with clickable portion Span clickable = span( "Click ", span("here")._class("link").onclick("showDetails()"), " for more information" ); // Text with tooltip Span tooltip = span("Hover over this text") .title("This is a tooltip"); // Text with language specification Span lang = span("Hola mundo") .lang("es");

See Also: