Created
March 21, 2019 04:44
-
-
Save libbyschuknight/bb882114b1525a11421aa8fb8319e0a7 to your computer and use it in GitHub Desktop.
CSS attribute value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* from https://css-tricks.com/almanac/selectors/a/attribute/ */ | |
[data-value] { | |
/* Attribute exists */ | |
} | |
[data-value="foo"] { | |
/* Attribute has this exact value */ | |
} | |
[data-value*="foo"] { | |
/* Attribute value contains this value somewhere in it */ | |
} | |
[data-value~="foo"] { | |
/* Attribute has this value in a space-separated list somewhere */ | |
} | |
[data-value^="foo"] { | |
/* Attribute value starts with this */ | |
} | |
[data-value|="foo"] { | |
/* Attribute value starts with this in a dash-separated list */ | |
} | |
[data-value$="foo"] { | |
/* Attribute value ends with this */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment