Class IdRule

All Implemented Interfaces:
AnimationIntf<CssRule>, BackgroundIntf<CssRule>, com.oorian.css.BasicBoxIntf<CssRule>, com.oorian.css.BasicUserInterfaceIntf<CssRule>, BorderIntf<CssRule>, com.oorian.css.ColorIntf<CssRule>, CountersIntf<CssRule>, com.oorian.css.CssStyleIntf<CssRule>, com.oorian.css.FilterEffectsIntf<CssRule>, com.oorian.css.FlexibleBoxLayoutIntf<CssRule>, com.oorian.css.FontIntf<CssRule>, com.oorian.css.GeneratedContentForPagedMediaIntf<CssRule>, com.oorian.css.ImageValuesAndReplacedContentIntf<CssRule>, com.oorian.css.ListIntf<CssRule>, com.oorian.css.MarqueeIntf<CssRule>, com.oorian.css.MaskingIntf<CssRule>, com.oorian.css.MultiColumnLayoutIntf<CssRule>, PagedMediaIntf<CssRule>, com.oorian.css.SpeechIntf<CssRule>, com.oorian.css.TableIntf<CssRule>, com.oorian.css.TextDecorationIntf<CssRule>, com.oorian.css.TextIntf<CssRule>, com.oorian.css.TransformIntf<CssRule>, com.oorian.css.TransitionIntf<CssRule>, com.oorian.css.WritingModeIntf<CssRule>

public class IdRule extends CssRule
Represents a CSS rule that targets elements by their ID attribute.

IdRule automatically prefixes each ID with the "#" symbol to create valid CSS ID selectors. Multiple IDs can be specified to create a grouped selector rule.

Example usage:

 IdRule headerRule = new IdRule("header", "mainNav");
 headerRule.setBackgroundColor(Color.WHITE);
 // Generates: #header, #mainnav { background-color: white; }
 
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • IdRule

      public IdRule(String... ids)
      Constructs an ID rule targeting elements with the specified IDs.
      Parameters:
      ids - One or more element IDs to target (without the "#" prefix).