Skip to content

Instantly share code, notes, and snippets.

@Uvacoder
Forked from emmabostian/attributes.css
Created October 23, 2022 14:01
Show Gist options
  • Select an option

  • Save Uvacoder/5f4d361fdf5635b1a29326b00c788144 to your computer and use it in GitHub Desktop.

Select an option

Save Uvacoder/5f4d361fdf5635b1a29326b00c788144 to your computer and use it in GitHub Desktop.
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
// This attribute value contains the word cool in a space-separated list
[value~='cool']
// This attribute value starts with the word cool
[value^='cool']
// This attribute value starts with cool in a dash-separated list
[value|='cool']
// This attribute value ends with the word cool
[value$='cool']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment