How to Add CSS Styling to An Element When Clicking It

How Do You Add CSS Styles on Click? Source: Jamie Street

New to CSS? Not sure how to add styles when clicking on an element?

Luckily, it’s pretty easy to do 😄 Here’s how it’s done:

Let’s Make a New Button 🕹️

<button class="button">Click Me!</button>

Let’s add a few default styles to the button: