JSFiddle - React, Tailwind, and code Playground
by sturobson
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 { cursor: crosshair; 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:first-of-type { margin-left: 30px; }
li:last-of-type { margin-right: 0px; }
li: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: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:first-of-type:before {
border: none;
width: 10px;
height: 40px;
background: orange;
left: -10px;
}
li:hover { cursor: pointer; background: white; }
li:hover:before { border-top: 40px solid white; }
li:hover:after { border-bottom: 40px solid white; }
li:first-of-type:hover:before { background: white; width: 10px;
height: 0px; }
li:last-of-type:after {
border: none;
width: 10px;
height: 40px;
background: orange;
right: -10px;
}
li:last-of-type:hover:after { background: white; width: 10px; height: 40px; }