JSFiddle - React, Tailwind, and code Playground
HTML
<div class="nav">
<div class="item">home</div>
<div class="item">login</div>
<div class="item">signup</div>
</div>
CSS
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
}
.nav {
display: table; // To center without giving a fixed width.
margin: 0 auto;
margin-top: 30px;
}
.nav:before, .nav:after {
display: table;
content: '';
}
.nav:after {
clear: both;
}
.nav .item {
float: left;
padding: 8px;
background: #f5f5f5;
}
.nav .item:hover {
background: #e5e5e5;
cursor: pointer;
}
.nav .item.active {
background: #e5e5e5;
}