.nav li { list-style:none; position:relative; display:inline-block; padding:20px 15px 5px 15px; margin-left:-10px; color:#fff; cursor:pointer; } .nav li::after { content:''; position:absolute; top:0; bottom:0; left:0; right:0; z-index:-1; background:#427DE9; border:1px solid #fff; border-top-right-radius:8px; border-top-left-radius:8px; transform:perspective(0.5em) rotateX(5deg); transform-origin:bottom; } .nav li:hover::after { background:#39a3f5; }