Export (0) Print
Expand All

Substring [*=] Attribute Selector New for Windows Internet Explorer 7

Matches the specified substring of an attribute value.

Syntax

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

Possible Values

att 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 Sheets (CSS) attribute/value pairs.

Remarks

This selector is available as of Internet Explorer 7.

This property is 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 Microsoft® 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

Class Selector, Equality [=] Attribute Selector, Existence [] Attribute Selector, Hyphen [|=] Attribute Selector, ID Selector, Prefix [^=] Attribute Selector, Suffix [$=] Attribute Selector, Type Selector, Universal (*) Selector, Whitespace [~=] Attribute Selector
Show:
© 2014 Microsoft