Defining styles for ID Selectors

ID selectors define style rules for an individual element. You can create an ID in the context of an element, or as a generic identifier. However, even as a generic identifier, an ID should be assigned to only one element in a document. IDs can be used within HTML elements or in scripts.

Web Target style sheet editors use generic IDs as style objects. Several scripting languages, such as JavaScript and VBScript, can manipulate these objects to dynamically change the appearance of elements associated with the ID.

StepsTo define styles for ID selectors:

  1. Right-click an item in the left pane of a style sheet editor, then select Insert ID Selector from the pop-up menu. (See “Global Style Sheet editor restrictions”.)

  2. In the Insert New ID Selector dialog box, identify the new ID for the style sheet.

  3. To create a generic ID, click OK

    or

    To assign the ID to an HTML tag, select the For HTML Element check box, then select an element and click OK.

    Shown is the Insert New ID Selector dialog box. The I D field at top displays the text s l e _ 2. A check box labeled For H T M L Element is selected and below it is a drop down list box with the INPUT element selected.
  4. With the new ID selected in the left pane, define styles for the ID in the tab pages in the right pane.