<ul class="snip1143">
<li class="current"><a href="#" data-hover="Home">Home</a></li>
<li><a href="#" data-hover="About Us">About Us</a></li>
<li><a href="#" data-hover="Blog">Blog</a></li>
<li><a href="#" data-hover="Services">Services</a></li>
<li><a href="#" data-hover="Products">Products</a></li>
<li><a href="#" data-hover="Contact">Contact</a></li>
</ul>
@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);
.snip1143 {
font-family: 'Raleway', Arial, sans-serif;
text-align: center;
text-transform: uppercase;
font-weight: 500;
}
.snip1143 * {
box-sizing: border-box;
-webkit-transition: all 0.35s ease;
transition: all 0.35s ease;
}
.snip1143 li {
display: inline-block;
list-style: outside none none;
margin: 0 1.5em;
overflow: hidden;
}
.snip1143 a {
padding: 0.3em 0;
color: rgba(255, 255, 255, 0.5);
position: relative;
display: inline-block;
letter-spacing: 1px;
margin: 0;
text-decoration: none;
}
.snip1143 a:before,
.snip1143 a:after {
position: absolute;
-webkit-transition: all 0.35s ease;
transition: all 0.35s ease;
}
.snip1143 a:before {
top: 100%;
display: block;
height: 3px;
width: 100%;
content: "";
background-color: #c0392b;
}
.snip1143 a:after {
padding: 0.3em 0;
position: absolute;
top: 100%;
left: 0;
content: attr(data-hover);
color: white;
white-space: nowrap;
}
.snip1143 li:hover a,
.snip1143 .current a {
transform: translateY(-100%);
}
/* Demo purposes only */
body {
height: 90vh;
display: flex;
align-items: center;
justify-content: center;
background: #212121;
}
/* Demo purposes only */
html {
height: 100%;
}
body {
background-color: #212121;
display: flex;
justify-content: center;
align-items: center;
flex-flow: wrap;
margin: 0;
height: 100%;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.