Skip to content

Instantly share code, notes, and snippets.

@hrdtbs
Created March 10, 2021 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrdtbs/10356ff95d829809936dd0a961330651 to your computer and use it in GitHub Desktop.
Save hrdtbs/10356ff95d829809936dd0a961330651 to your computer and use it in GitHub Desktop.
hover effectをmobile(ホバーすることができる入力メカニズムがある端末)でのみactiveに置き換えるCSS
@media (any-hover: hover) {
&:hover {
background-color: red;
}
}
@media not all and (any-hover: hover) {
&:active {
background-color: red;
}
}
@hrdtbs
Copy link
Author

hrdtbs commented Mar 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment