This topic has not yet been rated - Rate this topic

Whitespace attribute selector

Exactly matches the specified property value in a space-delimited list of values.

Syntax

[attr~=val] { sRules }

Possible values

attr

Either an identifier or a string.

val

Either an identifier or a string.

sRules

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

Remarks

This property is enabled only in standards-compliant mode (strict !DOCTYPE).

Attributes are case-sensitive.

If the target val contains whitespace, the rule will not match anything.

Example

The following style rule selects any property whose value contains the token "Two":

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

<div class="test" attr="One Two Three">Test for [~=] (Token) succeeded.</div>

Standards information

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.