.header ul{ max-width: 900px; margin: 0 auto; display: flex; flex-direction: row; justify-content: flex-end; align-items: center; flex-wrap: wrap; li { padding: 5% 2%; a { font-size: 0.875em; font-family: 'Roboto', sans-serif; text-decoration: none; text-transform: uppercase; color: aliceblue; display: inline-block; position: relative; } a:before, a:after { content: ""; display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-style: solid; border-color: #4bcaff;; } a:before { border-width: 2px 0 2px 0; transform: scaleX(0); } a:after { border-width: 0 2px 0 2px; transform: scaleY(0); } a:hover:before, a:hover:after { transform: scale(1, 1); color: #4bcaff; } } }
<div class="header"> <ul> <li><a href="#" class="effect-6">Home</a></li> <li><a href="#" class="effect-6">Services</a></li> <li><a href="#" class="effect-6">Portfolio</a></li> <li><a href="#" class="effect-6">Features</a></li> <li><a href="#" class="effect-6">Contact</a></li> </ul> </div>
If you use SCSS, then everything will work, although this is a very wild code ... If, after all, you do not use SCSS, then so:
.header ul{ max-width: 900px; margin: 0 auto; display: flex; flex-direction: row; justify-content: flex-end; align-items: center; flex-wrap: wrap; } li { padding: 5% 2%; } a { font-size: 0.875em; font-family: 'Roboto', sans-serif; text-decoration: none; text-transform: uppercase; color: aliceblue; display: inline-block;position: relative; } a:before, a:after { content: ""; display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-style: solid; border-color: #4bcaff; } a:before { border-width: 2px 0 2px 0; transform: scaleX(0); } a:after { border-width: 0 2px 0 2px; transform: scaleY(0); } a:hover:before, a:hover:after { transform: scale(1, 1); color: #4bcaff; }
<div class="header"> <ul> <li><a href="#" class="effect-6">Home</a></li> <li><a href="#" class="effect-6">Services</a></li> <li><a href="#" class="effect-6">Portfolio</a></li> <li><a href="#" class="effect-6">Features</a></li> <li><a href="#" class="effect-6">Contact</a></li> </ul> </div>
ulopening in html lost - br3t