Web Designer IDs as selectors

Previous Next

Within one page, all Web Designer objects have a unique ID. Examples of these IDs include:

SaveButton, CheckButton, NewButton, and DeleteButton button controls. "SaveButton" is the unique ID, ButtonControl is the class of the SaveButton control.

A "TitleLabel" LabelControl.

A "SearchGroup" ContainerControl.

A "SearchButton" ButtonControl.

Just as with classes, these IDs are generated into the client HTML documents. Here is an example:

<div id="TitleLabel" class="TitleLabelControl">Tours</div>

 

By using the (HTML) ID attribute as a selector, you can set style properties for each individual HTML element. You can attach a style sheet rule to a specific HTML element by preceding the ID name with the "#" symbol. For example, this style sheet rule specifies that all HTML elements with ID "Prompt" are in italics:

#Prompt{
   font-style: italic;
}