Wildcard Selectors (*, ^ and $) in CSS for classes

[attribute*=”txt”] Selector: The [attribute*=”txt”] selector is used to select that elements whose attribute value contains the specified sub string txt. This example shows how to use a wildcard to select all div with a class that contains txt. This could be at the start, the end or in the middle of the class.

[attribute^=”txt”] Selector: The [attribute^=”value”] selector is used to select those elements whose attribute value begins with a specified value txt. This example shows how to use a wildcard to select all div with a class that starts with txt.

[attribute$=”txt”] Selector: The [attribute$=”value”] selector is used to select those elements whose attribute value ends with a specified value txt. The following example selects all elements with a class attribute value that ends with txt.