js+css实现左侧伸缩导航菜单栏效果代码
代码语言:html
所属分类:菜单导航
代码描述:js+css实现左侧伸缩导航菜单栏效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.7.0.css">
<style>
:root {
--bg-black100: #353535;
--bg-black50: #eef0f4;
--bg-black20: #414546;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body { overflow: auto; }
body.dark {
--bg-black100: #fff;
--bg-black50: #000;
--bg-black20: #eef0f4;
}
.menu {
position: absolute;
width: 60px;
height: 600px;
background-color: var(--bg-black50);
z-index: 2;
top: 0;
bottom: 0;
left: 10px;
margin: auto;
border-radius: .8rem;
transition: .3s ease .15s;
font-family: sans-serif;
}
.menu.open { width: 240px; }
.menu a { text-decoration: none; }
.menu .actionBar {
width: 100%;
height: 10%;
padding: 0.5rem;
overflow: hidden;
}
.menu .actionBar div {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-around;
border-radius: .5rem;
transition: .3s ease;
}
.menu .actionBar div button {
background-color: transparent;
outline: none;
border: none;
border-radius: .5rem;
color: var(--bg-black100);
width: 45px;
height: 45px;
transition: .3s ease;
font-size: 1rem;
cursor: pointer;
}
.menu .actionBar div button:hover { background-color: rgb(132, 0, 255); }
.menu .actionBar div h3 { width: calc(100% - 45px); text-align: center; }
.menu .optionsBar {
overflow: hidden;
display: flex;
width: 100%;
height: 60%;
padding: 0 .5rem;
align-items: center;
flex-direction: column;
}
.menu .opti.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0