Substring [*=] Attribute Selector
Matches the specified substring of an attribute value.

Syntax

HTML[att*=val] { sRules }
ScriptingN/A

Possible Values

attMust be either an Identifier or a String.
valMust be either an Identifier or a String.
sRulesString that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs.

Remarks

Note   Requires Windows Internet Explorer 7 or later.
Note   Attribute selectors are enabled only in standards-compliant mode (strict !DOCTYPE).

Attributes are case-sensitive.

Example

The following style rule selects any attribute that contains the value "ai" within it.

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

<div class="test" attr="Contains">Test for [*=] (Substring) succeeded.</div>
This feature requires Windows Internet Explorer 7 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This selector is defined in Cascading Style Sheets (CSS), Level 3 (CSS3).

See Also

Tags :


Page view tracker