Matches the property, whatever its value.

Syntax

[attr] { sRules }

Possible values

attr

Either an identifier or a string.

sRules

A 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 elements that use the special property:

 Copy Code
<style>
    .test     {display: none;}
    [special] {display: block;}
</style>

<div class="test" special>Test for [] (Existence) succeeded.</div>

Standards information

See also