Kalani
Kalani

Reputation: 1

CSS: How do I add a mobile hover effect on a button tap?

How would I go about adding styling when a user taps on a button via mobile for gmail and outlook? My goal is to have the user know that they tapped the button on mobile.

Upvotes: 0

Views: 68

Answers (1)

MontyGoldy
MontyGoldy

Reputation: 749

there are two ways of achieving this by using a tag. First one use a:target

    a {
      padding: 10px;
      background: green;
    }

   a:target {
      background: red;
    }

Second one is using a:visited

   a {
      padding: 10px;
      background: green;
    }

   a:visited {
      background: red;
    }

Upvotes: 1

Related Questions