Example: Setting a CSS Property For a Group of Objects |
Suppose, you want to provide some TextColumnControl objects on a web page with specific style characteristics. For example, you want a red background for all mandatory fields. To implement this:
#RedColorGroup input.ColumnControl { background-color: red } This style sheet rule specifies that within the HTML element with ID: RedColorGroup, all input elements that belong to the ColumnControl class (all actual text boxes) get a red background color. This style sheet rule is an example of a contextual selector. |