Export (0) Print
Expand All

Suffix attribute selector

Matches the specified suffix of a property value.

Syntax

[attr$=val] { sRules }

Possible values

attr

Either an identifier or a string.

val

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 ends with "n":

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

<div class="test" attr="Green">Test for [$=] (Suffix) succeeded.</div>

Standards information

This selector is defined in Cascading Style Sheets (CSS), Level 3 (CSS3) Ee371203.xtlink_newWindow(en-us,Expression.40).png.

See also

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

Community Additions

ADD
Show:
© 2014 Microsoft