JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
<a href="#" class="button">Hello</a>
CSS
.button {
display: inline-block;
vertical-align: top;
color: #000;
background: #aaa;
text-shadow: 1px 1px 1px #fff;
border: 0;
padding: 0.6em 1.2em;
margin: 0 0 4px 0;
text-decoration: none;
border-radius: 6px;
}
.button:hover {
color: #fff;
text-shadow: none;
}
.button:active {
margin: 4px 0 0 0;
}
.active {
background: #fff;
text-shadow: none;
color: #000;
}
JavaScript
$('.button').click(function(){
$(this).siblings().removeClass('active');
$(this).addClass('active');
});