HTML
Código:
CSS<nav class="mainNav"> <ul> <li><a href="https://www.google.com.ar/" data-title="MENU1">MENU1</a></li> <li><a href="https://www.google.com.ar/" data-title="MENU2">MENU2</a></li> </ul> </nav>
Código:
.mainNav { float: left; transform: perspective(500px); transform-style: preserve-3d; } .mainNav ul { list-style: none; padding: 0; } .mainNav li { display: inline-block; } .mainNav a { background-color: RED; border: 1px solid WHITE; backface-visibility: hidden; color: white; display: block; font: bold 1em/3 sans-serif; padding: 0 1.5em; position: relative; text-align: center; text-decoration: none; font-size: 14px; transition: 0.3s; transform-origin: 0% 50%; transform-style: preserve-3d; width: 6em; } .mainNav a:after { background-color: RED; border: 1px solid white; color: white; font-size: 15px; content: attr(data-title); height: 100%; left: 0; line-height: 3; position: absolute; top: 100%; transform: rotateX(-90deg); transform-origin: 0 0; width: 100%; } .mainNav a:before { bottom: 0; content: ''; height: 3em; position: absolute; right: 0; top: 0; transform-origin: 0 0; width: 3em; } .mainNav li:nth-child(-n+2) a:before { transform: rotateY(90deg) translateZ(3em); } .mainNav li:nth-child(n+3) a:before { left: 0; right: auto; transform: rotateY(90deg); } .mainNav li:hover a { transform: rotateX(90deg) translateY(-1.5em) translateZ(1.5em); } .mainNav .current:hover a { transform: rotateX(0deg) translateY(0) translateZ(0); }