Skip to content

Instantly share code, notes, and snippets.

@mjuhl
Last active December 18, 2015 19:39
Show Gist options
  • Save mjuhl/5834232 to your computer and use it in GitHub Desktop.
Save mjuhl/5834232 to your computer and use it in GitHub Desktop.
CSS 2.1/IE 8 compatible selectors for use with querySelector in IE8

What DOES work?

    • (wildcard selector)
  • .class-one.class-two (multiple class names)

  • ~

  • [attr]

  • [attr=value]

  • [attr~=value] (includes value; space-separated)

  • [attr^=value] (begins with value)

  • [attr$=value] (ends with value)

  • [attr*=value] (contains value; not necessarily space-separated)

  • [attr|=value] (attribute value starts with "value" or "value-")

  • :before

  • :after

  • :first-letter

  • :first-line

  • :hover

  • :link

  • :active (sometimes)


What does NOT work?

  • :not (ie9)
  • :checked (ie9)
  • :disabled (ie9)
  • :enabled (ie9)
  • :default
  • :target (ie9?)
  • :empty (ie9)
  • :first-of-type
  • :last-child
  • :nth-child()
  • :nth-last-child()
  • :nth-last-of-type()
  • :nth-of-type()
  • :only-child
  • :only-of-type
  • :root
  • :in-range
  • :out-of-range
  • :optional (ie10)
  • :read-only
  • :read-write
  • :required (ie10)
  • :valid (ie10)
  • :invalid (ie10)

What might work?

  • :visited
  • :first-child
  • :focus (ie8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment