css实现左侧自动伸缩菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现左侧自动伸缩菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url(https://fonts.googleapis.com/css?family=Titillium+Web:300); body { margin: 0px; padding: 0px; font-family: "Open Sans", arial; background: #C7B7A7 ; color: #fff; font-weight: 300; } } .logo {} .settings { height: 73px; float: left; width: 250px; margin: 0px; text-align: center; font-size: 20px; font-family: 'Strait', sans-serif; } .cscrollbar { height: 90%; width: 100%; overflow-y: hidden; overflow-x: hidden; } .scrollbar:hover { height: 90%; width: 100%; overflow-y: scroll; overflow-x: hidden; } /* Scrollbar Style */ #style-1::-webkit-scrollbar-track { border-radius: 2px; } #style-1::-webkit-scrollbar { width: 5px; background-color: #F7F7F7; } #style-1::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); background-color: #BFBFBF; } /* Scrollbar End */ .fa-lg { font-size: 1em; } .fa { position: relative; display: table-cell; width: 55px; height: 36px; text-align: center; top: 12px; font-size: 20px; } .main-menu:hover, nav.main-menu.expanded { width: 250px; overflow: hidden; opacity: 1; } .main-menu { background: #F7F7F7; position: absolute; top: 0; bottom: 0; height: 100%; left: 0; width: 55px; overflow: hidden; -webkit-transition: width .2s linear; transition: width .2s linear; -webkit-transform: translateZ(0) scale(1,1); box-shadow: 1px 0 15px rgba(0, 0, 0, 0.07); opacity: 1; } .main-menu>ul { margin: 7px 0; } .main-menu li { position: relative; display: block; width: 250px; } .main-menu li>a { position: relative; width: 255px; display: table; border-collapse: collapse; border-spacing: 0; color: #8a8a8a; font-size: 13px; text-decoration: none; -webkit-transform: translateZ(0) scale(1,1); -webkit-transition: all .14s linear; transition: all .14s linear; font-family: 'Strait', sans-serif; border-top: 1px solid #f2f2f2; text-shadow: 1px 1px 1px #fff; } .main-menu .nav-icon { position: relative; display: table-cell; width: 55px; height: 36px; text-align: center; vertical-align: middle; font-size: 18px; } .main-menu .nav-text { position: relative; display: table-cell; vertical-align: middle; width: 190px; font-family: 'Titillium Web', sans-serif; } .main-menu .share {} .main-menu .fb-like { left: 180px; position: absolute; top: 15px; } .main-menu>ul.logout { position: absolute; left: 0; bottom: 0; } .no-touch .scrollable.hover { overflow-y: hidden; } .no-touch .scrollable.hover:hover { overflow-y: auto; overflow: visible; } /* Logo Hover Property */ .settings:hover, settings:focus { -webkit-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0; -moz-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0; -o-transition: all 0.2s ease-in-out, width 0, height 0, to.........完整代码请登录后点击上方下载按钮下载查看
网友评论0