JSFiddle - React, Tailwind, and code Playground
by Clear
HTML
<ul class="menu">
<li id="red">H <p>Home</p></li>
<li id="yellow">C <p>Cerca</p></li>
<li id="green">R <p>Regolamenti</p></li>
<li id="blue">C <p>Competizioni</p></li>
<li id="purple">E <p>Epic Gazzette</p></li>
</ul>
CSS
* {
box-sizing: border-box;
}
@-webkit-keyframes delay {
from {
color: rgba(255,255,255,0);
}
to {
color: rgba(255,255,255,1);
}
}
@-moz-keyframes slide {
from {
color: rgba(255,255,255,0);
}
to {
color: rgba(255,255,255,1);
}
}
@-o-keyframes slide {
from {
color: rgba(255,255,255,0);
}
to {
color: rgba(255,255,255,1);
}
}
body {
margin: 0;
}
.menu {
height: 38px;
width: 100%;
border-bottom: 1px;
list-style: none;
position: relative;
background: #fff;
margin: 0px;
padding: 0px;
box-shadow: 0px 1px 5px rgba(0,0,0,0.2);
}
menu:after {
content: " ";
display: table;
clear: both;
}
.menu li {
height: 38px;
width: 38px;
line-height: 38px;
color: #fff;
float: left;
padding-left: 13px;
}
#red {
background: #ef3b3b;
transition-property: width;
transition-duration: 0.3s;
position: relative;
}
#red p {
display: none;
}
#red:hover {
width: 150px;
cursor: pointer;
}
#red:hover p {
display: inline;
position: absolute;
right: 5px;
top: -15px;
-webkit-animation: delay 0.3s 1 ease;
-moz-animation: delay 0.3s 1 ease;
-o-animation: delay 0.3s 1 ease;
animation: delay 0.3s 1 ease;
}
#yellow {
background: #f2f053;
transition-property: width;
transition-duration: 0.3s;
position: relative;
}
#yellow p {
display: none;
}
#yellow:hover {
width: 150px;
cursor: pointer;
}
#yellow:hover p {
display: inline;
position: absolute;
right: 5px;
top: -15px;
-webkit-animation: delay 0.3s 1 ease;
-moz-animation: delay 0.3s 1 ease;
-o-animation: delay 0.3s 1 ease;
animation: delay 0.3s 1 ease;
}
#green {
background: #40db61;
transition-property: width;
transition-duration: 0.3s;
position: relative;
}
#green p {
display: none;
}
#green:hover {
width: 150px;
cursor: pointer;
}
#green:hover p {
display: inline;
position: absolute;
...