Export (0) Print
Expand All

ID

Matches the class property of the specified element.

#value { sRules }

value

String that specifies the value of the id attribute.

sRules

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 (#).

Ee371275.alert_note(en-us,Expression.30).gifNote:

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:

<style>
    #navigation {line-height: 0px; font-size: x-small;}
</style> 

Community Additions

ADD
Show:
© 2014 Microsoft