CSS ID Selector
What is a CSS ID Selector?
- The ID selector specifies an element whose id attribute value is equal to a specific value. This selector is specified by preceding the id attribute value with a # symbol. If the # symbol is immediately preceded by a selector then the style will only be applied to a matching element that also has a matching id attribute value. In the following example,
both of the style declarations apply to the <h1> element.
- Note: An ID attribute uniquely identifies an element. Therefore, it is not valid for multiple elements to have the same ID attribute value.