.mobile{ width: 100%; height:3.5rem; float: left; position: fixed; z-index: 555; background: white; } .mobile-inner-header{ width: 13%; height: 3.5rem; position: absolute; top: 0; right: 0; } .mobile-inner-header-icon{ color: #333; height: 3.5rem; font-size:2rem; text-align: center; float:right; width: 3.5rem; position: relative; -webkit-transition: background 0.5s; -moz-transition: background 0.5s; -o-transition: background 0.5s; transition: background 0.5s; } .mobile-inner-header-icon:hover{ background-color: rgba(255,255,255,0.2); cursor: pointer; } .mobile-inner-header-icon span{ position: absolute; left: calc((100% - 25px) / 2); top: calc((100% - 1px) / 2); width: 1.5rem; height: 0.14rem; background-color: #333; } .mobile-inner-header-icon span:nth-child(1){ transform: translateY(7px) rotate(0deg); } .mobile-inner-header-icon span:nth-child(2){ transform: translateY(-7px) rotate(0deg); } .mobile-inner-header-icon span:nth-child(3){ transform: translateY(0) rotate(0deg); } .mobile-inner-header-icon-click span:nth-child(1){ animation-duration: 0.5s; animation-fill-mode: both; animation-name: clickfirst; } .mobile-inner-header-icon-click span:nth-child(2){ animation-duration: 0.5s; animation-fill-mode: both; animation-name: clicksecond; } .mobile-inner-header-icon-click span:nth-child(3){ display: none; } @keyframes clickfirst { 0% { transform: translateY(7px) rotate(0deg); } 100% { transform: translateY(0) rotate(45deg); } } @keyframes clicksecond { 0% { transform: translateY(-7px) rotate(0deg); } 100% { transform: translateY(0) rotate(-45deg); } } .mobile-inner-header-icon-out span:nth-child(1){ animation-duration: 0.5s; animation-fill-mode: both; animation-name: outfirst; } .mobile-inner-header-icon-out span:nth-child(2){ animation-duration: 0.5s; animation-fill-mode: both; animation-name: outsecond; } @keyframes outfirst { 0% { transform: translateY(0) rotate(-45deg); } 100% { transform: translateY(-7px) rotate(0deg); } } @keyframes outsecond { 0% { transform: translateY(0) rotate(45deg); } 100% { transform: translateY(7px) rotate(0deg); } } .mobile-inner-nav{ background-color: rgba(255,255,255,0.9); width: 100%; position: absolute; top: 50px; left: 0; padding-top: 30px; padding-bottom: 80px; display: none; } .mobile-inner-nav a{ display: inline-block; line-height: 50px; width: 80%; margin-left: 10%; text-align: center; border-bottom: solid 1px #f4f4f4; -webkit-transition: all 0.5s; -moz-transition: all 0.5s; -o-transition: all 0.5s; transition: all 0.5s; font-weight:300; } .mobile-inner-nav a:hover{ color: rgba(255,255,255,0.4); border-bottom: solid 1px rgba(255,255,255,0.2); }