JSFiddle - React, Tailwind, and code Playground
HTML
<nav>
<a>
<div>text</div>
</a>
</nav>
CSS
nav {
display: flex;
flex-direction: row;
flex: 1;
}
nav a {
line-height: 1rem;
font-size: 1rem;
position: relative;
overflow: hidden;
height: 2rem;
padding: 0rem 0.5rem 0rem 0.5rem;
color: white;
text-decoration: none;
background-color: black;
transition: background-color 0.5s, color 0.5s, height 0.5s;
}
nav a div {
padding: 0.5em 0rem 0.5rem 0rem;
}