JSFiddle - React, Tailwind, and code Playground
by kiokotzu
HTML
<ul>
<li><a href="">search</a></li><li><a href="">images</a></li><li><a href="">maps</a></li><li><a href="">play</a></li><li><a href="">youtube</a></li><li><a href="">news</a></li><li><a href="">mail</a></li><li><a href="">a really long one to end with</a></li>
</ul
CSS
* {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
body { font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; font-size: 16px; }
ul { padding-top: 10px; padding-bottom: 10px; padding-left: 40px; background: grey; width: 100%; height: 60px; display: block; vertical-align: middle; }
li { position: relative; float: left; background: orange; line-height: 20px; padding: 10px 3px; margin-right: 30px; }
a { display: block; text-decoration: none; color: #000; text-transform: capitalize; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
li:nth-child(odd):before {
content: "";
position: absolute;
background: none;
border-left: 20px solid transparent;
border-right: 0px solid transparent;
border-bottom: 40px solid orange;
left: -20px;
top: 0;
}
li:nth-child(odd):after {
content: "";
position: absolute;
width: 0;
height: 0;
border-left: 0px solid transparent;
border-right: 20px solid transparent;
border-bottom: 40px solid orange;
right: -20px;
top: 0;
}
li:nth-child(even):before {
content: "";
position: absolute;
background: none;
border-left: 20px solid transparent;
border-right: 0px solid transparent;
border-top: 40px solid orange;
left: -20px;
top: 0;
}
li:nth-child(even):after {
content: "";
position: absolute;
width: 0;
height: 0;
border-left: 0px solid transparent;
border-right: 20px solid transparent;
border-top: 40px solid orange;
right: -20px;
top: 0;
}
li:hover { cursor: pointer; background: white; }
li:nth-child(odd):hover:before { border-bottom: 40px solid white; }
li:nth-child(odd):hover:after { border-bottom: 40px solid white; }
li:nth-child(even):hover:before { border-top: 40px solid white; }
li:nth-child(even):hover:after { border-top: 40px solid...