Efek hover pada menu menggunakan border.
<ul>
<li>
<a href="#">home<span></span><span></span></a>
</li>
<li>
<a href="#">about<span></span><span></span></a>
</li>
<li>
<a href="#">services<span></span><span></span></a>
</li>
</ul>
@import url(https://fonts.googleapis.com/css?family=Raleway:400,500,800);
body {
background-color: #333;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Raleway', Arial, sans-serif;
}
ul {
padding: 0;
display: flex;
}
ul li {
list-style: none;
padding: 10px 40px;
}
ul li a {
text-decoration: none;
text-transform: uppercase;
font-size: 24px;
color: white;
position: relative;
padding: 5px;
}
a:hover {
color: #ff0;
}
span:first-child:before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 8px;
height: 8px;
background-color: transparent;
border-top: 2px solid #ff0;
border-left: 2px solid #ff0;
transition: 0.2s;
opacity: 0;
}
span:first-child:after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 8px;
height: 8px;
background-color: transparent;
border-top: 2px solid #ff0;
border-right: 2px solid #ff0;
transition: 0.2s;
opacity: 0;
}
span:last-child:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 8px;
height: 8px;
background-color: transparent;
border-bottom: 2px solid #ff0;
border-left: 2px solid #ff0;
transition: 0.2s;
opacity: 0;
}
span:last-child:after {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 8px;
height: 8px;
background-color: transparent;
border-bottom: 2px solid #ff0;
border-right: 2px solid #ff0;
transition: 0.2s;
opacity: 0;
}
a:hover span:first-child:before {
top: -10px;
left: -10px;
opacity: 1;
}
a:hover span:first-child:after {
top: -10px;
right: -10px;
opacity: 1;
}
a:hover span:last-child:before {
bottom: -10px;
left: -10px;
opacity: 1;
}
a:hover span:last-child:after {
bottom: -10px;
right: -10px;
opacity: 1;
}