div+css实现大气简洁侧边栏图标导航菜单点击效果代码
代码语言:html
所属分类:菜单导航
代码描述:div+css实现大气简洁侧边栏图标导航菜单点击效果代码
代码标签: div css 大气 简洁 侧边栏 图标 导航 菜单 点击
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
>
<style>
@import url('https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
:root {
--clr: #14161e;
}
body {
min-height: 100vh;
background: var(--clr);
}
.sidebar {
position: absolute;
width: 80px;
height: 100vh;
background: #fff;
transition: 0.5s;
padding-left: 10px;
overflow: hidden;
}
.sidebar.active {
width: 300px;
}
.sidebar ul {
position: relative;
height: 100vh;
}
.sidebar ul li {
position: relative;
list-style: none;
}
.sidebar ul li.active {
background: var(--clr);
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
}
.sidebar ul li.active::before {
content: '';
position: absolute;
top: -20px;
right: 0;
width: 20px;
height: 20px;
border-bottom-right-radius: 20px;
box-shadow: 5px 5px 0 5px var(--clr);
background: transparent;
}
.sidebar ul li.active::after {
content: '';
position: absolute;
bottom: -20px;
right: 0;
width: 20px;
height.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0