Matches the class property of the specified element.

#value { sRules }


String that specifies the value of the id attribute.


String that specifies one or more cascading style sheet property/value pairs.

The ID property allows authors to uniquely identify an element instance in the document tree. ID selectors match an element instance based on its identifier. The ID property value must immediately follow the number sign (#).


Though some older browsers will allow multiple elements to share a single ID value, best-practices dictate that only one instance of a specific ID exist on a page. An element can have only one ID property.

In the event that a style declaration conflicts with another declaration, the rule with a higher level of specificity is used. (See Understanding selectors.) If a class selector and an ID selector are in conflict, the ID selector is chosen.

The following style rule applies to the element with id="navigation" and its descendants:

    #navigation {line-height: 0px; font-size: x-small;}

Community Additions