Snippet 27 : Menu Effect On Hover – 1

Pada snippet kali ini akan membuat efek hover untuk menu.

<ul>
  <li><a href="#">home</a></li>
  <li><a href="#">about</a></li>
  <li><a href="#">portfolio</a></li>
</ul>
body {
 margin: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 height: 100vh;
 font-family: sans-serif;
}

ul {
  margin: 0;
  padding: 0;
  display: flex;
  list-style-type: none;
}

ul li a {
  color: #272727;
  font-size: 20px;
  text-decoration: none;
  text-transform: uppercase;
  padding: 5px 10px;
  margin: 0px 10px;
  position: relative;
  transition: all .5s
}

a:hover {
  background-color: #e91e63;
  color:white;
}

a:before {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 12px;
  height: 12px;
  border: 3px solid #e91e63;
  border-width: 0 0 3px 3px;
  opacity: 0;
  transition: all 0.3s
}

a:hover:before {
  opacity: 1;
  bottom: -8px;
  left: -8px;
}

a:after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 12px;
  height: 12px;
  border: 3px solid #e91e63;
  border-width: 3px 3px 0 0;
  opacity: 0;
  transition: all 0.3s;
}

a:hover:after {
  opacity: 1;
  top: -8px;
  right: -8px;
}
Sharing is caring:

Leave a Comment