Class Mark<T extends Mark<T>>


public class Mark<T extends Mark<T>> extends PhrasingContentElement<T>
Represents an HTML <mark> (marked/highlighted text) element.

The <mark> element represents text that has been marked or highlighted for reference or notation purposes. It indicates relevance in a particular context, such as highlighting search terms in search results, marking important passages in quoted text, or indicating matches in a find operation. Browsers typically render marked text with a yellow background color.

Features:

  • Marks text as highlighted or notable
  • Typically rendered with yellow background
  • Used for search results, important passages, and matches
  • Conveys semantic importance in context

Usage:


 // Highlight a search term
 Mark highlighted = new Mark("search term");

 // Highlight text in a paragraph
 P paragraph = new P();
 paragraph.addText("This is a ");
 paragraph.addElement(new Mark("highlighted"));
 paragraph.addText(" word in the sentence.");

 // Mark important information
 P note = new P();
 note.addElement(new Mark("Important:"));
 note.addText(" This information requires attention.");
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Mark

      public Mark()
      Constructs an empty <mark> element.

      Creates a mark element without initial content. Text can be added later using inherited methods.

    • Mark

      public Mark(String text)
      Constructs a <mark> element with the specified text content.
      Parameters:
      text - the text to be marked/highlighted; may be null or empty