Export (0) Print
Expand All

Equality attribute selector

Exactly matches the specified property value.

Syntax

[attr=val] { sRules }

Possible values

attr

Must be either an identifier or a string.

val

Must be either an identifier or a string.

sRules

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

Remarks

Property selectors are enabled only in standards-compliant mode (strict !DOCTYPE).

Attributes are case-sensitive.

Example

The following style rule selects any property whose value is exactly test-value:

<style>
    .test           {display: none;}
    [attr="test-value"] {display: block;}
</style>

<div class="test" attr="test-value">
    Test for [=] (test-value) succeeded.
</div>

Standards information

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions

ADD
Show:
© 2014 Microsoft