.btn { padding:0px; width:100px; height:40px; position:relative; cursor:pointer; font-size:20px; line-height:40px; text-align:center; } .btn::after,.btn::before { content:""; border:2px solid #333; display:block; width:50px; height:20px; } .btn::after { position:absolute; bottom:0px; right:0px; border-top-color:transparent; border-left-color:transparent; } .btn::before { position:absolute; top:0px; left:0px; border-bottom-color:transparent; border-right-color:transparent; } .btn:hover::after,.btn:hover::before { content:""; border:2px solid #333; display:block; width:110px; height:50px; transition:all 0.5s ease; } .btn:hover::after { position:absolute; bottom:0px; right:0px; border-top-color:transparent; border-left-color:transparent; } .btn:hover::before { position:absolute; top:0px; left:0px; border-bottom-color:transparent; border-right-color:transparent; } .nav { width:300px; height:40px; margin:0px auto; } .nav ul { padding:0px; width:100%; } .nav ul:after { content:""; width:0px; height:0px; display:block; visibility:hidden; clear:both; } .nav li { position:relative; width:100px; float:left; list-style:none; height:40px; line-height:40px; text-align:center; font-size:16px; transition:all 0.5s ease; } .nav li:hover { color:red; font-size:18px; } .nav li::after { content:""; width:0%; height:40px; display:block; border-bottom:2px solid #333; position:absolute; top:0px; left:45px; transition:all 0.5s ease; } .nav li:hover::after { content:""; width:100%; height:40px; display:block; border-bottom:2px solid #333; position:absolute; top:0px; left:0px; } .nav a { text-decoration:none; color:#333; } .pie { position:relative; } .bg { width:100px; height:100px; border:0px; border-radius:50px; background-color:brown; position:absolute; top:0px; left:0px; } .left { width:50px; height:100px; background-color:forestgreen; border-left:0px solid forestgreen; border-top-left-radius:50px; border-bottom-left-radius:50px; float:left; position:absolute; top:0px; left:0px; } .right { width:50px; height:100px; background-color:forestgreen; border-left:0px solid forestgreen; border-top-right-radius:50px; border-bottom-right-radius:50px; float:left; transform:rotate(0deg); transform-origin:0% 50%; transition:transform 0.5s ease; position:absolute; top:0px; left:50px; } .right:hover { transform:rotate(90deg); transform-origin:0% 50%; }