ionicons+css实现左侧垂直侧边栏菜单伸缩明暗切换效果代码

代码语言:html

所属分类:菜单导航

代码描述:ionicons+css实现左侧垂直侧边栏菜单伸缩明暗切换效果代码,支持暗色切换,菜单伸缩。

代码标签: ionicons css 左侧 垂直 侧边栏 菜单 伸缩 明暗 切换

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- 引入css文件 -->

        <!-- 引入字体图标文件 -->

        <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ionicons.esm.js"></script>
  <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ionicons.7.1.0.js"></script>


        <title>伸缩侧边栏</title>
        <style>

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

li {
    list-style: none
}

body {
    background-color: #e3e9f8;
    width: 100vw;
    height: 100vh;
    display: flex;
    background-color: #e3e9f8
}

.nav {
    flex: 1;
    height: 64px;
    color: #7a7a7a;
    font-size: 36px;
    font-weight: 600;
    padding-left: 100px;
    line-height: 64px
}

.menu {
    position: relative;
    width: 240px;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
    padding: 10px 14px;
    transition: width .3s ease-in
}

.menu-author {
    display: flex;
    align-items: center;
    max-height: 40px;
    margin-bottom: 30px;
    cursor: pointer
}

.author-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 40px;
    font-size: 14px;
    transition: all .4s
}

.author-n.........完整代码请登录后点击上方下载按钮下载查看

网友评论0