Attribute Selector: [attr~=val]

Pattern:

[attr~=val]

 

Definition:

 

The [attr~=val] selector matches any element with the attr attribute, and one of its attr attribute's value (separated by whitespaces) is exactly val

 

Examples:

Style all elements with a title attribute whose value contains the word "highlight" 

[title~=highlight] { background-color: yellow; }

 

w10schools
2014-11-11 03:07:10
Comments
Leave a Comment

Please login to continue.