我正在创建一个导航栏,如下所示。
我想要实现的主要功能是:
我的问题是:
任何帮助表示赞赏! :)
$(".burger-btn-wrapper").click(function() {
$(".main-sidebar").toggleClass("main-sidebar-view");
});
.container {
height: 768px;
}
.navbar {
display: block;
width: 100%;
position: relative;
margin-bottom: 640px;
color: #333;
background-color: #fff;
}
.navbar-logo-wrapper {
position: absolute;
height: 60px;
width: 100%;
top: 0;
left: 0;
text-align: center;
z-index: 999;
}
.navbar-logo-wrapper img {
width: 32px;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-top {
width: 100%;
height: 60px;
box-shadow: 0px 1px 8px 0 rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32px;
box-sizing: border-box;
position: relative;
background-color: #fff;
}
.navbar-top-left {
z-index: 999;
}
.burger-btn-wrapper {
display: inline-block;
text-align: center;
margin: 0 16px 0 0;
}
.burger-btn-wrapper i {
font-size: 16px;
color: #333;
line-height: 60px;
transform: translateY(1px);
}
.module-name {
height: 60px;
line-height: 60px;
text-transform: uppercase;
display: inline-block;
font-size: 13px;
font-weight: 700;
color: #333;
}
.navbar-top-right {
z-index: 999;
}
.navbar-top-middle {
height: 60px;
text-align: center;
position: relative;
line-height: 0;
}
.modules-icon {
vertical-align: middle;
display: inline-block;
width: 60px;
text-align: center;
}
.modules-icon i {
font-size: 16px;
color: #333;
line-height: 60px;
}
.navbar-profile {
display: inline-block;
vertical-align: middle;
line-height: 0;
cursor: pointer;
}
.navbar-profile img {
vertical-align: top;
}
.profpic-wrapper {
display: inline-block;
vertical-align: middle;
width: 60px;
height: 60px;
cursor: pointer;
}
.navbar-profpic {
width: 40px;
height: 40px;
background-color: #00c983;
border-radius: 40px;
position: relative;
margin-left: 10px;
margin-top: 10px;
}
.profile-initial {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.profile-name {
display: inline-block;
vertical-align: middle;
font-size: 13px;
}
.profile-dropdown-icon {
vertical-align: middle;
display: inline-block;
margin-left: 8px;
}
.profile-dropdown-icon i {
font-size: 10px;
}
.navbar-wrapper {
display: inline-block;
width: 100%;
}
.navbar-top-middle img {
height: 32px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-menu {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.navbar-menu-list {
width: 750px;
list-style-type: none;
margin: 0;
padding: 15px 0;
cursor: pointer;
z-index: -1;
margin-left: 0;
}
.navbar-menu-each {
padding-left: 32px;
padding-right: 32px;
display: inline-block;
position: relative;
}
.navbar-menu-each:first-child {
padding-left: 32px;
}
.navbar-menu-each a {
color: #333;
font-size: 13px;
text-decoration: none;
}
.menu-on a {
font-weight: 700;
color: #00c983;
}
.navbar-page-name {
display: block;
font-size: 22px;
height: 60px;
line-height: 60px;
border-top: solid 0.5px #DEF5ED;
border-bottom: solid 0.5px #DEF5ED;
background-color: #F0FBF7;
color: #333;
padding-left: 32px;
}
.navbar-menu::-webkit-scrollbar {
height: 0;
}
.navbar-menu::-webkit-scrollbar-thumb {
background-color: transparent;
}
.profile-dropdown {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
position: absolute;
cursor: pointer;
top: 106px;
}
.submenu-dropdown {
display: none;
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0, 0, 0, 0.15);
cursor: pointer;
position: absolute;
top: 20px;
left:0;
border: solid 1px #000;
}
.navbar-menu-each:hover > .submenu-dropdown,
.submenu-dropdown:hover {
display: block;
}
.submenu-dropdown-each {
display: block;
line-height: 48px;
font-size: 13px;
color: #333;
width: auto;
padding: 0 32px 0 24px;
}
.submenu-dropdown-each:hover {
background: #f8f8f8;
}
.submenu-selected {
font-weight: 700;
color: #00c983;
}
.profile-dropdown-check i {
display: none;
}
.profile-dropdown-check i.role-active {
display: inline-block;
color: #00c983;
}
.main-sidebar {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
width: 240px;
font-size: 13px;
color: #333;
position: absolute;
top: 51px;
left: -260px;
-webkit-transition: left 0.5s;
transition: left 0.5s;
height: 717px;
}
.main-sidebar-list-wrapper {
height: 669px;
width: 240px;
overflow: auto;
}
.main-sidebar-view {
left: 0;
-webkit-transition: left 0.5s;
transition: left 0.5s;
}
.sidebar-section {
width: 240px;
}
.sidebar-section li {
display: block;
line-height: 48px;
padding-left: 16px;
height: 48px;
}
.sidebar-section-title {
border-bottom: solid 1px #eee;
font-size: 16px;
}
.sidebar-icon {
position: relative;
display: inline-block;
width: 28px;
height: 48px;
}
.sidebar-icon img {
width: 18px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.sidebar-menu {
display: inline-block;
vertical-align: top;
}
.main-sidebar-list-wrapper::-webkit-scrollbar {
height: 0;
}
.main-sidebar-list-wrapper::-webkit-scrollbar-thumb {
background-color: transparent;
}
.main-sidebar-footer {
height: 48px;
line-height: 48px;
text-align: center;
border-top: solid 1px #eee;
}
@media (max-width: 767px) and (min-width: 576px) {
.navbar-top {
padding: 0 24px;
}
.navbar-menu-each:first-child {
padding-left: 24px;
}
.navbar-page-name {
padding-left: 24px;
}
.callout {
right: 94px;
}
}
@media (max-width: 575px) {
.module-name {
display: none;
}
.profile-name {
display: none;
}
.modules-icon {
display: none;
}
.navbar-top {
padding: 0 16px;
}
.navbar-menu-each:first-child {
padding-left: 16px;
}
.navbar-page-name {
padding-left: 16px;
}
.profile-dropdown-icon {
margin-left: 0;
}
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<div class="container">
<div class="navbar">
<div class="main-sidebar">
<div class="main-sidebar-list-wrapper">
<ul class="sidebar-section">
<li class="sidebar-section-title">Organization</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/LZ44Z0dPvtn2OCGT02lwNZuaUK76Zw69uaYSF4sTe63PtTpKS4IiUM7LjsV5VvlH1hsB6bZM4rA8g9fVsYgUzg/192"></span>
<span class="sidebar-menu">Company</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/8pNCxwrs9k-2fnR6iCzgQ-FEhutp_EcFTTfb9jD207NZSwBU98yuTSPZAKwsh7muBJKKG-MBcsgoqbEpXnZLnQ/213"></span>
<span class="sidebar-menu">Employee</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/mE5M0CywlR63kvqGKenpBEdDFYpOnpHB02javJrGr8r0gJGl_-vuUnKJJpWe6pZChsjIq1yXUgofhicw7MvFCw/177"></span>
<span class="sidebar-menu">Termination</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Compensation & Benefits</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/vYgvWe324-eiGFdWDNoBi7WrWHUAFhEbZCoLWve5NE2rBrFrGmK7ZLjW3W0ggCHce1BCyY6FFTzxRm-Fg9VmBA/168"></span>
<span class="sidebar-menu">BPJS Ketenagakerjaan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/bVKXdl3sBeP8-w1wTrEapdUOlcJFSPi4_koRbRVtzL2NR8N-BPZdJUdpPWjSXC13Um6GLbt5DO1DV2t_j7hQDw/168"></span>
<span class="sidebar-menu">BPJS Kesehatan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/TaVNZzoRbkdvziFtWEyv4sEVQMnVVteQt2CB9aCU4xyOdTaCTDAqL9mqUA-3nGmdJZ7qzLZbxXr2xfXjlVDpDg/173"></span>
<span class="sidebar-menu">Payroll</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/NAZCBsbI_bURxMPsr3N05H2_d8KSiz_RtfaMqHp8Tg8tKFEb4RN-5aHgFQiz0y05Ik4BAD8RMRb5LC-Ufg35zA/175"></span>
<span class="sidebar-menu">PPh 21</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Admin Panel</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/FNTOwLJTLz1ndzUxgINBH_tCYJgn7rp-HvtVlpTSN1RQ1yuy1q7UskqQikaey0uHl2Fu7C-rXOgaw_VsGH82Lg/136"></span>
<span class="sidebar-menu">User Management</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/DLaWkbWQ4jxYfEVNpCKBxOyS8G1mzuN24jzbf62tvMsYRvMD0zob2s2K1mBCj62YTYM_MaQmJlt6KmS0WY2uwA/159"></span>
<span class="sidebar-menu">Master Data</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/h2z5yDkjFcZ5OwhHWcI6VrhUL9Yj-u43QPEjlo7XyHE2pR-ghxrJdXw8mfB5C89AzEd403gqfCrd2JAUMbJ1xQ/199"></span>
<span class="sidebar-menu">Log</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/cn4XSK1tZu9KoSq5Q7iQXAMWcqjw5JolDHCvP52UD2wvu2brkBoit1F7SDUJmFVChGbo1LthZixKzx5ee3jJsQ/156"></span>
<span class="sidebar-menu">Data Migration</span>
</li>
</ul>
</div>
<div class="main-sidebar-footer">
© CATAPA 2017
</div>
</div>
<div class="navbar-logo-wrapper">
<img class="navbar-tree" src="https://cdn.frontify.com/api/screen/thumbnail/7UV_lfX5OBfHxFn5lc3ygK8UTU3z5pivwY9QDSDIOiFemj-DdmDzmwiPvbibaG63IMXz-MmGOs4aH-UqgoT9gw/350">
</div>
<div class="navbar-top">
<div class="navbar-top-left">
<div class="burger-btn-wrapper">
<i class="fas fa-bars"></i>
</div>
<div class="module-name">Employee</div>
</div>
<div class="navbar-top-right">
<div class="modules-icon"><i class="fas fa-th"></i></div>
<div class="navbar-profile">
<div class="profpic-wrapper">
<div class="navbar-profpic">
<div class="profile-initial">DJ</div>
</div>
</div>
<div class="profile-name">Dennis Jonathan</div>
<div class="profile-dropdown-icon"><i class="fas fa-chevron-down"></i></div>
</div>
</div>
</div>
<div class="navbar-menu">
<ul class="navbar-menu-list">
<li class="navbar-menu-each">
<a href="#">Employee Directory</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>New Employee Registration</li>
<li class='submenu-dropdown-each submenu-selected'>Employee List</li>
<li class='submenu-dropdown-each'>Employee Rehire</li>
<li class='submenu-dropdown-each'>Employee Without Bank Account</li>
<li class='submenu-dropdown-each'>Employee Without PPh 21</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Memo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Memo Template</li>
<li class='submenu-dropdown-each'>Print Memo</li>
</ul>
</li>
<li class="navbar-menu-each"><a href="#">Bulk Update</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Download & Upload</li>
<li class='submenu-dropdown-each'>Send Email</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Approvals and Undo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Approvals</li>
<li class='submenu-dropdown-each'>Employment Status Undo</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Report</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Report</li>
<li class='submenu-dropdown-each'>Headcount Report</li>
<li class='submenu-dropdown-each'>Employee Recapitulation Report</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-page-name">
Employee List
</div>
</div>
<div class="cover-top"></div>
<div class="cover-left"></div>
<div class="cover-right"></div>
<div class="cover-bottom"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
答案 0 :(得分:1)
首先,您应该只发布相关代码,以便人们可以快速找到问题。
第一部分:
将此行添加到css可能有所帮助。问题是由优先级进行的,但老实说,有太多的html和css需要通过。
.main-sidebar.main-sidebar-view{
z-index:1000;
background-color:#fff;
}
第二部分:
下拉列表无法打开可能是因为没有javascript可以执行某些操作,或者您没有粘贴它?
$(".burger-btn-wrapper").click(function() {
$(".main-sidebar").toggleClass("main-sidebar-view");
$(".submenu-dropdown").hide();
});
.container {
height: 768px;
}
.navbar {
display: block;
width: 100%;
position: relative;
margin-bottom: 640px;
color: #333;
background-color: #fff;
}
.navbar-logo-wrapper {
position: absolute;
height: 60px;
width: 100%;
top: 0;
left: 0;
text-align: center;
z-index: 999;
}
.navbar-logo-wrapper img {
width: 32px;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-top {
width: 100%;
height: 60px;
box-shadow: 0px 1px 8px 0 rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32px;
box-sizing: border-box;
position: relative;
background-color: #fff;
}
.navbar-top-left {
z-index: 999;
}
.burger-btn-wrapper {
display: inline-block;
text-align: center;
margin: 0 16px 0 0;
}
.burger-btn-wrapper i {
font-size: 16px;
color: #333;
line-height: 60px;
transform: translateY(1px);
}
.module-name {
height: 60px;
line-height: 60px;
text-transform: uppercase;
display: inline-block;
font-size: 13px;
font-weight: 700;
color: #333;
}
.navbar-top-right {
z-index: 999;
}
.navbar-top-middle {
height: 60px;
text-align: center;
position: relative;
line-height: 0;
}
.modules-icon {
vertical-align: middle;
display: inline-block;
width: 60px;
text-align: center;
}
.modules-icon i {
font-size: 16px;
color: #333;
line-height: 60px;
}
.navbar-profile {
display: inline-block;
vertical-align: middle;
line-height: 0;
cursor: pointer;
}
.navbar-profile img {
vertical-align: top;
}
.profpic-wrapper {
display: inline-block;
vertical-align: middle;
width: 60px;
height: 60px;
cursor: pointer;
}
.navbar-profpic {
width: 40px;
height: 40px;
background-color: #00c983;
border-radius: 40px;
position: relative;
margin-left: 10px;
margin-top: 10px;
}
.profile-initial {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.profile-name {
display: inline-block;
vertical-align: middle;
font-size: 13px;
}
.profile-dropdown-icon {
vertical-align: middle;
display: inline-block;
margin-left: 8px;
}
.profile-dropdown-icon i {
font-size: 10px;
}
.navbar-wrapper {
display: inline-block;
width: 100%;
}
.navbar-top-middle img {
height: 32px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-menu {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.navbar-menu-list {
width: 750px;
list-style-type: none;
margin: 0;
padding: 15px 0;
cursor: pointer;
z-index: -1;
margin-left: 0;
}
.navbar-menu-each {
padding-left: 32px;
padding-right: 32px;
display: inline-block;
position: relative;
}
.navbar-menu-each:first-child {
padding-left: 32px;
}
.navbar-menu-each a {
color: #333;
font-size: 13px;
text-decoration: none;
}
.menu-on a {
font-weight: 700;
color: #00c983;
}
.navbar-page-name {
display: block;
font-size: 22px;
height: 60px;
line-height: 60px;
border-top: solid 0.5px #DEF5ED;
border-bottom: solid 0.5px #DEF5ED;
background-color: #F0FBF7;
color: #333;
padding-left: 32px;
}
.navbar-menu::-webkit-scrollbar {
height: 0;
}
.navbar-menu::-webkit-scrollbar-thumb {
background-color: transparent;
}
.profile-dropdown {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
position: absolute;
cursor: pointer;
top: 106px;
}
.submenu-dropdown {
display: none;
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0, 0, 0, 0.15);
cursor: pointer;
position: absolute;
top: 20px;
left:0;
}
.navbar-menu-each:hover > .submenu-dropdown,
.submenu-dropdown:hover {
display: block;
}
.submenu-dropdown-each {
display: block;
line-height: 48px;
font-size: 13px;
color: #333;
width: auto;
padding: 0 32px 0 24px;
}
.submenu-dropdown-each:hover {
background: #f8f8f8;
}
.submenu-selected {
font-weight: 700;
color: #00c983;
}
.profile-dropdown {
padding-top: 8px;
width: 208px;
top: 53px;
right: 20px;
display: none;
}
.profile-dropdown-each {
display: block;
font-size: 13px;
line-height: 36px;
padding-left: 16px;
}
.profile-dropdown-each-section {
color: #aaa;
text-transform: uppercase;
font-weight: 700;
}
.profile-dropdown-check {
float: right;
margin-right: 16px;
}
.profile-dropdown-each-border-top {
border-top: solid 1px #eee;
}
.switch-language-group {
float: right;
margin-right: 16px;
}
.button-language {
height: 24px;
width: 32px;
border: solid 1px #c4c4c4;
display: inline-block;
line-height: 24px;
text-align: center;
}
.button-language-left {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform: translateX(4px);
}
.button-language-right {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.button-language-active {
background-color: #00c983;
color: #fff;
border: solid 1px #00c983;
}
.profile-dropdown-check i {
display: none;
}
.profile-dropdown-check i.role-active {
display: inline-block;
color: #00c983;
}
.navbar-module-wrapper {
display: inline-block;
width: 49%;
vertical-align: middle;
text-align: center;
height: 100px;
padding-top: 8px;
padding-bottom: 8px;
cursor: pointer;
border-radius: 3px;
}
.navbar-module-wrapper:hover {
background: #f8f8f8;
}
.navbar-module-wrapper-left {
}
.navbar-module-icon {
width: 48px;
padding: 16px 16px 8px 16px;
}
.caption-basic {
transform: translateY(8px);
}
.icon-tm {
width: 44px;
transform: translateY(-4px);
}
.caption-tm {
transform: translateY(-8px);
}
.icon-recr {
width: 46px;
}
.caption-recr {
transform: translateY(4px);
}
.icon-talent {
width: 38px;
transform: translateY(-2px);
}
.caption-talent {
transform: translateY(-6px);
}
.icon-bm {
width: 50px;
}
.caption-bm {
transform: translateY(-4px);
}
.navbar-module-name {
line-height: 16px;
vertical-align: middle;
height: 60px;
}
.main-sidebar {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
width: 240px;
font-size: 13px;
color: #333;
position: absolute;
top: 51px;
left: -260px;
-webkit-transition: left 0.5s;
transition: left 0.5s;
height: 717px;
}
.main-sidebar-list-wrapper {
height: 669px;
width: 240px;
overflow: auto;
}
.main-sidebar-view {
left: 0;
-webkit-transition: left 0.5s;
transition: left 0.5s;
}
.sidebar-section {
width: 240px;
}
.sidebar-section li {
display: block;
line-height: 48px;
padding-left: 16px;
height: 48px;
}
.sidebar-section-title {
border-bottom: solid 1px #eee;
font-size: 16px;
}
.sidebar-icon {
position: relative;
display: inline-block;
width: 28px;
height: 48px;
}
.sidebar-icon img {
width: 18px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.sidebar-menu {
display: inline-block;
vertical-align: top;
}
.main-sidebar-list-wrapper::-webkit-scrollbar {
height: 0;
}
.main-sidebar-list-wrapper::-webkit-scrollbar-thumb {
background-color: transparent;
}
.main-sidebar-footer {
height: 48px;
line-height: 48px;
text-align: center;
border-top: solid 1px #eee;
}
@media (max-width: 767px) and (min-width: 576px) {
.navbar-top {
padding: 0 24px;
}
.navbar-menu-each:first-child {
padding-left: 24px;
}
.navbar-page-name {
padding-left: 24px;
}
.callout {
right: 94px;
}
}
@media (max-width: 575px) {
.module-name {
display: none;
}
.profile-name {
display: none;
}
.modules-icon {
display: none;
}
.navbar-top {
padding: 0 16px;
}
.navbar-menu-each:first-child {
padding-left: 16px;
}
.navbar-page-name {
padding-left: 16px;
}
.profile-dropdown-icon {
margin-left: 0;
}
}
.main-sidebar.main-sidebar-view{
z-index:1000;
background-color:#fff;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<div class="container">
<div class="navbar">
<div class="main-sidebar">
<div class="main-sidebar-list-wrapper">
<ul class="sidebar-section">
<li class="sidebar-section-title">Organization</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/LZ44Z0dPvtn2OCGT02lwNZuaUK76Zw69uaYSF4sTe63PtTpKS4IiUM7LjsV5VvlH1hsB6bZM4rA8g9fVsYgUzg/192"></span>
<span class="sidebar-menu">Company</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/8pNCxwrs9k-2fnR6iCzgQ-FEhutp_EcFTTfb9jD207NZSwBU98yuTSPZAKwsh7muBJKKG-MBcsgoqbEpXnZLnQ/213"></span>
<span class="sidebar-menu">Employee</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/mE5M0CywlR63kvqGKenpBEdDFYpOnpHB02javJrGr8r0gJGl_-vuUnKJJpWe6pZChsjIq1yXUgofhicw7MvFCw/177"></span>
<span class="sidebar-menu">Termination</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Compensation & Benefits</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/vYgvWe324-eiGFdWDNoBi7WrWHUAFhEbZCoLWve5NE2rBrFrGmK7ZLjW3W0ggCHce1BCyY6FFTzxRm-Fg9VmBA/168"></span>
<span class="sidebar-menu">BPJS Ketenagakerjaan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/bVKXdl3sBeP8-w1wTrEapdUOlcJFSPi4_koRbRVtzL2NR8N-BPZdJUdpPWjSXC13Um6GLbt5DO1DV2t_j7hQDw/168"></span>
<span class="sidebar-menu">BPJS Kesehatan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/TaVNZzoRbkdvziFtWEyv4sEVQMnVVteQt2CB9aCU4xyOdTaCTDAqL9mqUA-3nGmdJZ7qzLZbxXr2xfXjlVDpDg/173"></span>
<span class="sidebar-menu">Payroll</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/NAZCBsbI_bURxMPsr3N05H2_d8KSiz_RtfaMqHp8Tg8tKFEb4RN-5aHgFQiz0y05Ik4BAD8RMRb5LC-Ufg35zA/175"></span>
<span class="sidebar-menu">PPh 21</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Admin Panel</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/FNTOwLJTLz1ndzUxgINBH_tCYJgn7rp-HvtVlpTSN1RQ1yuy1q7UskqQikaey0uHl2Fu7C-rXOgaw_VsGH82Lg/136"></span>
<span class="sidebar-menu">User Management</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/DLaWkbWQ4jxYfEVNpCKBxOyS8G1mzuN24jzbf62tvMsYRvMD0zob2s2K1mBCj62YTYM_MaQmJlt6KmS0WY2uwA/159"></span>
<span class="sidebar-menu">Master Data</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/h2z5yDkjFcZ5OwhHWcI6VrhUL9Yj-u43QPEjlo7XyHE2pR-ghxrJdXw8mfB5C89AzEd403gqfCrd2JAUMbJ1xQ/199"></span>
<span class="sidebar-menu">Log</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/cn4XSK1tZu9KoSq5Q7iQXAMWcqjw5JolDHCvP52UD2wvu2brkBoit1F7SDUJmFVChGbo1LthZixKzx5ee3jJsQ/156"></span>
<span class="sidebar-menu">Data Migration</span>
</li>
</ul>
</div>
<div class="main-sidebar-footer">
© CATAPA 2017
</div>
</div>
<div class="navbar-logo-wrapper">
<img class="navbar-tree" src="https://cdn.frontify.com/api/screen/thumbnail/7UV_lfX5OBfHxFn5lc3ygK8UTU3z5pivwY9QDSDIOiFemj-DdmDzmwiPvbibaG63IMXz-MmGOs4aH-UqgoT9gw/350">
</div>
<div class="navbar-top">
<div class="navbar-top-left">
<div class="burger-btn-wrapper">
<i class="fas fa-bars"></i>
</div>
<div class="module-name">Employee</div>
</div>
<div class="navbar-top-right">
<div class="modules-icon"><i class="fas fa-th"></i></div>
<div class="navbar-profile">
<div class="profpic-wrapper">
<div class="navbar-profpic">
<div class="profile-initial">DJ</div>
</div>
</div>
<div class="profile-name">Dennis Jonathan</div>
<div class="profile-dropdown-icon"><i class="fas fa-chevron-down"></i></div>
</div>
</div>
</div>
<div class="navbar-menu">
<ul class="navbar-menu-list">
<li class="navbar-menu-each">
<a href="#">Employee Directory</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>New Employee Registration</li>
<li class='submenu-dropdown-each submenu-selected'>Employee List</li>
<li class='submenu-dropdown-each'>Employee Rehire</li>
<li class='submenu-dropdown-each'>Employee Without Bank Account</li>
<li class='submenu-dropdown-each'>Employee Without PPh 21</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Memo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Memo Template</li>
<li class='submenu-dropdown-each'>Print Memo</li>
</ul>
</li>
<li class="navbar-menu-each"><a href="#">Bulk Update</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Download & Upload</li>
<li class='submenu-dropdown-each'>Send Email</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Approvals and Undo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Approvals</li>
<li class='submenu-dropdown-each'>Employment Status Undo</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Report</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Report</li>
<li class='submenu-dropdown-each'>Headcount Report</li>
<li class='submenu-dropdown-each'>Employee Recapitulation Report</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-page-name">
Employee List
</div>
</div>
<div class="cover-top"></div>
<div class="cover-left"></div>
<div class="cover-right"></div>
<div class="cover-bottom"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
答案 1 :(得分:1)
根据您在评论中提到的第一个问题,您希望第一行后面的侧边栏。
Look z-index
按照stack
属性工作,因此位于堆栈顶部的元素将服务于其他元素。
假设elementA
有一个默认z-index:0
,而另一个elementB
,你给z-index:1
将在堆栈中位于顶部,然后将提供elementA。
在您的情况下,您希望sidebar
位于第一行nav
后面。
.main-sidebar{
z-index: -1; // This will lower the stack order compair to zero index elements
}
看看代码片段,但是侧边栏现在已经完成了所有内容,因此您需要根据自己的要求进行定位。
现在这将在每个元素后面服务,除非任何元素堆栈顺序低于<-1
。
您的第二个问题 它是不可见的或工作似乎是一些js问题或你错过了添加一些使得悬停选项启用的js。更新它我将尝试解决它。
$(".burger-btn-wrapper").click(function() {
$(".main-sidebar").toggleClass("main-sidebar-view");
$(".submenu-dropdown").hide();
});
&#13;
.container {
height: 768px;
}
.main-sidebar{
z-index : -1;
top : 100%;
}
.navbar {
display: block;
width: 100%;
position: relative;
margin-bottom: 640px;
color: #333;
background-color: #fff;
}
.navbar-logo-wrapper {
position: absolute;
height: 60px;
width: 100%;
top: 0;
left: 0;
text-align: center;
z-index: 999;
}
.navbar-logo-wrapper img {
width: 32px;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-top {
width: 100%;
height: 60px;
box-shadow: 0px 1px 8px 0 rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32px;
box-sizing: border-box;
position: relative;
background-color: #fff;
}
.navbar-top-left {
z-index: 999;
}
.burger-btn-wrapper {
display: inline-block;
text-align: center;
margin: 0 16px 0 0;
}
.burger-btn-wrapper i {
font-size: 16px;
color: #333;
line-height: 60px;
transform: translateY(1px);
}
.module-name {
height: 60px;
line-height: 60px;
text-transform: uppercase;
display: inline-block;
font-size: 13px;
font-weight: 700;
color: #333;
}
.navbar-top-right {
z-index: 999;
}
.navbar-top-middle {
height: 60px;
text-align: center;
position: relative;
line-height: 0;
}
.modules-icon {
vertical-align: middle;
display: inline-block;
width: 60px;
text-align: center;
}
.modules-icon i {
font-size: 16px;
color: #333;
line-height: 60px;
}
.navbar-profile {
display: inline-block;
vertical-align: middle;
line-height: 0;
cursor: pointer;
}
.navbar-profile img {
vertical-align: top;
}
.profpic-wrapper {
display: inline-block;
vertical-align: middle;
width: 60px;
height: 60px;
cursor: pointer;
}
.navbar-profpic {
width: 40px;
height: 40px;
background-color: #00c983;
border-radius: 40px;
position: relative;
margin-left: 10px;
margin-top: 10px;
}
.profile-initial {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.profile-name {
display: inline-block;
vertical-align: middle;
font-size: 13px;
}
.profile-dropdown-icon {
vertical-align: middle;
display: inline-block;
margin-left: 8px;
}
.profile-dropdown-icon i {
font-size: 10px;
}
.navbar-wrapper {
display: inline-block;
width: 100%;
}
.navbar-top-middle img {
height: 32px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-menu {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.navbar-menu-list {
width: 750px;
list-style-type: none;
margin: 0;
padding: 15px 0;
cursor: pointer;
z-index: -1;
margin-left: 0;
}
.navbar-menu-each {
padding-left: 32px;
padding-right: 32px;
display: inline-block;
position: relative;
}
.navbar-menu-each:first-child {
padding-left: 32px;
}
.navbar-menu-each a {
color: #333;
font-size: 13px;
text-decoration: none;
}
.menu-on a {
font-weight: 700;
color: #00c983;
}
.navbar-page-name {
display: block;
font-size: 22px;
height: 60px;
line-height: 60px;
border-top: solid 0.5px #DEF5ED;
border-bottom: solid 0.5px #DEF5ED;
background-color: #F0FBF7;
color: #333;
padding-left: 32px;
}
.navbar-menu::-webkit-scrollbar {
height: 0;
}
.navbar-menu::-webkit-scrollbar-thumb {
background-color: transparent;
}
.profile-dropdown {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
position: absolute;
cursor: pointer;
top: 106px;
}
.submenu-dropdown {
display: none;
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0, 0, 0, 0.15);
cursor: pointer;
position: absolute;
top: 20px;
left:0;
}
.navbar-menu-each:hover > .submenu-dropdown,
.submenu-dropdown:hover {
display: block;
}
.submenu-dropdown-each {
display: block;
line-height: 48px;
font-size: 13px;
color: #333;
width: auto;
padding: 0 32px 0 24px;
}
.submenu-dropdown-each:hover {
background: #f8f8f8;
}
.submenu-selected {
font-weight: 700;
color: #00c983;
}
.profile-dropdown {
padding-top: 8px;
width: 208px;
top: 53px;
right: 20px;
display: none;
}
.profile-dropdown-each {
display: block;
font-size: 13px;
line-height: 36px;
padding-left: 16px;
}
.profile-dropdown-each-section {
color: #aaa;
text-transform: uppercase;
font-weight: 700;
}
.profile-dropdown-check {
float: right;
margin-right: 16px;
}
.profile-dropdown-each-border-top {
border-top: solid 1px #eee;
}
.switch-language-group {
float: right;
margin-right: 16px;
}
.button-language {
height: 24px;
width: 32px;
border: solid 1px #c4c4c4;
display: inline-block;
line-height: 24px;
text-align: center;
}
.button-language-left {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform: translateX(4px);
}
.button-language-right {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.button-language-active {
background-color: #00c983;
color: #fff;
border: solid 1px #00c983;
}
.profile-dropdown-check i {
display: none;
}
.profile-dropdown-check i.role-active {
display: inline-block;
color: #00c983;
}
.navbar-module-wrapper {
display: inline-block;
width: 49%;
vertical-align: middle;
text-align: center;
height: 100px;
padding-top: 8px;
padding-bottom: 8px;
cursor: pointer;
border-radius: 3px;
}
.navbar-module-wrapper:hover {
background: #f8f8f8;
}
.navbar-module-wrapper-left {
}
.navbar-module-icon {
width: 48px;
padding: 16px 16px 8px 16px;
}
.caption-basic {
transform: translateY(8px);
}
.icon-tm {
width: 44px;
transform: translateY(-4px);
}
.caption-tm {
transform: translateY(-8px);
}
.icon-recr {
width: 46px;
}
.caption-recr {
transform: translateY(4px);
}
.icon-talent {
width: 38px;
transform: translateY(-2px);
}
.caption-talent {
transform: translateY(-6px);
}
.icon-bm {
width: 50px;
}
.caption-bm {
transform: translateY(-4px);
}
.navbar-module-name {
line-height: 16px;
vertical-align: middle;
height: 60px;
}
.main-sidebar {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
width: 240px;
font-size: 13px;
color: #333;
position: absolute;
top: 51px;
left: -260px;
-webkit-transition: left 0.5s;
transition: left 0.5s;
height: 717px;
}
.main-sidebar-list-wrapper {
height: 669px;
width: 240px;
overflow: auto;
}
.main-sidebar-view {
left: 0;
-webkit-transition: left 0.5s;
transition: left 0.5s;
}
.sidebar-section {
width: 240px;
}
.sidebar-section li {
display: block;
line-height: 48px;
padding-left: 16px;
height: 48px;
}
.sidebar-section-title {
border-bottom: solid 1px #eee;
font-size: 16px;
}
.sidebar-icon {
position: relative;
display: inline-block;
width: 28px;
height: 48px;
}
.sidebar-icon img {
width: 18px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.sidebar-menu {
display: inline-block;
vertical-align: top;
}
.main-sidebar-list-wrapper::-webkit-scrollbar {
height: 0;
}
.main-sidebar-list-wrapper::-webkit-scrollbar-thumb {
background-color: transparent;
}
.main-sidebar-footer {
height: 48px;
line-height: 48px;
text-align: center;
border-top: solid 1px #eee;
}
@media (max-width: 767px) and (min-width: 576px) {
.navbar-top {
padding: 0 24px;
}
.navbar-menu-each:first-child {
padding-left: 24px;
}
.navbar-page-name {
padding-left: 24px;
}
.callout {
right: 94px;
}
}
@media (max-width: 575px) {
.module-name {
display: none;
}
.profile-name {
display: none;
}
.modules-icon {
display: none;
}
.navbar-top {
padding: 0 16px;
}
.navbar-menu-each:first-child {
padding-left: 16px;
}
.navbar-page-name {
padding-left: 16px;
}
.profile-dropdown-icon {
margin-left: 0;
}
}
&#13;
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<div class="container">
<div class="navbar">
<div class="main-sidebar">
<div class="main-sidebar-list-wrapper">
<ul class="sidebar-section">
<li class="sidebar-section-title">Organization</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/LZ44Z0dPvtn2OCGT02lwNZuaUK76Zw69uaYSF4sTe63PtTpKS4IiUM7LjsV5VvlH1hsB6bZM4rA8g9fVsYgUzg/192"></span>
<span class="sidebar-menu">Company</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/8pNCxwrs9k-2fnR6iCzgQ-FEhutp_EcFTTfb9jD207NZSwBU98yuTSPZAKwsh7muBJKKG-MBcsgoqbEpXnZLnQ/213"></span>
<span class="sidebar-menu">Employee</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/mE5M0CywlR63kvqGKenpBEdDFYpOnpHB02javJrGr8r0gJGl_-vuUnKJJpWe6pZChsjIq1yXUgofhicw7MvFCw/177"></span>
<span class="sidebar-menu">Termination</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Compensation & Benefits</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/vYgvWe324-eiGFdWDNoBi7WrWHUAFhEbZCoLWve5NE2rBrFrGmK7ZLjW3W0ggCHce1BCyY6FFTzxRm-Fg9VmBA/168"></span>
<span class="sidebar-menu">BPJS Ketenagakerjaan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/bVKXdl3sBeP8-w1wTrEapdUOlcJFSPi4_koRbRVtzL2NR8N-BPZdJUdpPWjSXC13Um6GLbt5DO1DV2t_j7hQDw/168"></span>
<span class="sidebar-menu">BPJS Kesehatan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/TaVNZzoRbkdvziFtWEyv4sEVQMnVVteQt2CB9aCU4xyOdTaCTDAqL9mqUA-3nGmdJZ7qzLZbxXr2xfXjlVDpDg/173"></span>
<span class="sidebar-menu">Payroll</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/NAZCBsbI_bURxMPsr3N05H2_d8KSiz_RtfaMqHp8Tg8tKFEb4RN-5aHgFQiz0y05Ik4BAD8RMRb5LC-Ufg35zA/175"></span>
<span class="sidebar-menu">PPh 21</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Admin Panel</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/FNTOwLJTLz1ndzUxgINBH_tCYJgn7rp-HvtVlpTSN1RQ1yuy1q7UskqQikaey0uHl2Fu7C-rXOgaw_VsGH82Lg/136"></span>
<span class="sidebar-menu">User Management</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/DLaWkbWQ4jxYfEVNpCKBxOyS8G1mzuN24jzbf62tvMsYRvMD0zob2s2K1mBCj62YTYM_MaQmJlt6KmS0WY2uwA/159"></span>
<span class="sidebar-menu">Master Data</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/h2z5yDkjFcZ5OwhHWcI6VrhUL9Yj-u43QPEjlo7XyHE2pR-ghxrJdXw8mfB5C89AzEd403gqfCrd2JAUMbJ1xQ/199"></span>
<span class="sidebar-menu">Log</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/cn4XSK1tZu9KoSq5Q7iQXAMWcqjw5JolDHCvP52UD2wvu2brkBoit1F7SDUJmFVChGbo1LthZixKzx5ee3jJsQ/156"></span>
<span class="sidebar-menu">Data Migration</span>
</li>
</ul>
</div>
<div class="main-sidebar-footer">
© CATAPA 2017
</div>
</div>
<div class="navbar-logo-wrapper">
<img class="navbar-tree" src="https://cdn.frontify.com/api/screen/thumbnail/7UV_lfX5OBfHxFn5lc3ygK8UTU3z5pivwY9QDSDIOiFemj-DdmDzmwiPvbibaG63IMXz-MmGOs4aH-UqgoT9gw/350">
</div>
<div class="navbar-top">
<div class="navbar-top-left">
<div class="burger-btn-wrapper">
<i class="fas fa-bars"></i>
</div>
<div class="module-name">Employee</div>
</div>
<div class="navbar-top-right">
<div class="modules-icon"><i class="fas fa-th"></i></div>
<div class="navbar-profile">
<div class="profpic-wrapper">
<div class="navbar-profpic">
<div class="profile-initial">DJ</div>
</div>
</div>
<div class="profile-name">Dennis Jonathan</div>
<div class="profile-dropdown-icon"><i class="fas fa-chevron-down"></i></div>
</div>
</div>
</div>
<div class="navbar-menu">
<ul class="navbar-menu-list">
<li class="navbar-menu-each">
<a href="#">Employee Directory</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>New Employee Registration</li>
<li class='submenu-dropdown-each submenu-selected'>Employee List</li>
<li class='submenu-dropdown-each'>Employee Rehire</li>
<li class='submenu-dropdown-each'>Employee Without Bank Account</li>
<li class='submenu-dropdown-each'>Employee Without PPh 21</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Memo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Memo Template</li>
<li class='submenu-dropdown-each'>Print Memo</li>
</ul>
</li>
<li class="navbar-menu-each"><a href="#">Bulk Update</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Download & Upload</li>
<li class='submenu-dropdown-each'>Send Email</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Approvals and Undo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Approvals</li>
<li class='submenu-dropdown-each'>Employment Status Undo</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Report</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Report</li>
<li class='submenu-dropdown-each'>Headcount Report</li>
<li class='submenu-dropdown-each'>Employee Recapitulation Report</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-page-name">
Employee List
</div>
</div>
<div class="cover-top"></div>
<div class="cover-left"></div>
<div class="cover-right"></div>
<div class="cover-bottom"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
&#13;
答案 2 :(得分:1)
我改变了:
.main-sidebar { z-index: 10; }
.navbar-top { z-index: 11; }
.navbar-logo { z-index: 11; }
$(".burger-btn-wrapper").click(function() {
$(".main-sidebar").toggleClass("main-sidebar-view");
$(".submenu-dropdown").hide();
});
.container {
height: 768px;
}
.cover-top {
border-top: solid 12px #fff;
position: absolute;
top: -4px;
left: 0;
width: 100%;
height: 0;
}
.cover-left {
border-left: solid 12px #fff;
position: absolute;
left: -4px;
top: 0;
width: 0;
height: 100%;
}
.cover-right {
border-right: solid 12px #fff;
position: absolute;
top: 0;
right: -4px;
width: 0;
height: 100%;
}
.cover-bottom {
border-bottom: solid 12px #fff;
position: absolute;
top: 772px;
left: 0;
width: 100%;
height: 0;
}
.navbar {
display: block;
width: 100%;
position: relative;
margin-bottom: 640px;
color: #333;
background-color: #fff;
}
.navbar-logo-wrapper {
position: absolute;
height: 60px;
width: 100%;
top: 0;
left: 0;
text-align: center;
z-index: 11;
}
.navbar-logo-wrapper img {
width: 32px;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-top {
width: 100%;
height: 60px;
box-shadow: 0px 1px 8px 0 rgba(0,0,0,0.1);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 32px;
box-sizing: border-box;
position: relative;
background-color: #fff;
z-index: 11;
}
.navbar-top-left {
z-index: 999;
}
.burger-btn-wrapper {
display: inline-block;
text-align: center;
margin: 0 16px 0 0;
}
.burger-btn-wrapper i {
font-size: 16px;
color: #333;
line-height: 60px;
transform: translateY(1px);
}
.module-name {
height: 60px;
line-height: 60px;
text-transform: uppercase;
display: inline-block;
font-size: 13px;
font-weight: 700;
color: #333;
}
.navbar-top-right {
z-index: 999;
}
.navbar-top-middle {
height: 60px;
text-align: center;
position: relative;
line-height: 0;
}
.modules-icon {
vertical-align: middle;
display: inline-block;
width: 60px;
text-align: center;
}
.modules-icon i {
font-size: 16px;
color: #333;
line-height: 60px;
}
.navbar-profile {
display: inline-block;
vertical-align: middle;
line-height: 0;
cursor: pointer;
}
.navbar-profile img {
vertical-align: top;
}
.profpic-wrapper {
display: inline-block;
vertical-align: middle;
width: 60px;
height: 60px;
cursor: pointer;
}
.navbar-profpic {
width: 40px;
height: 40px;
background-color: #00c983;
border-radius: 40px;
position: relative;
margin-left: 10px;
margin-top: 10px;
}
.profile-initial {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.profile-name {
display: inline-block;
vertical-align: middle;
font-size: 13px;
}
.profile-dropdown-icon {
vertical-align: middle;
display: inline-block;
margin-left: 8px;
}
.profile-dropdown-icon i {
font-size: 10px;
}
.navbar-wrapper {
display: inline-block;
width: 100%;
}
.navbar-top-middle img {
height: 32px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.navbar-menu {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.navbar-menu-list {
width: 750px;
list-style-type: none;
margin: 0;
padding: 15px 0;
cursor: pointer;
z-index: -1;
margin-left: 0;
}
.navbar-menu-each {
padding-left: 32px;
padding-right: 32px;
display: inline-block;
position: relative;
}
.navbar-menu-each:first-child {
padding-left: 32px;
}
.navbar-menu-each a {
color: #333;
font-size: 13px;
text-decoration: none;
}
.menu-on a {
font-weight: 700;
color: #00c983;
}
.navbar-page-name {
display: block;
font-size: 22px;
height: 60px;
line-height: 60px;
border-top: solid 0.5px #DEF5ED;
border-bottom: solid 0.5px #DEF5ED;
background-color: #F0FBF7;
color: #333;
padding-left: 32px;
}
.navbar-menu::-webkit-scrollbar {
height: 0;
}
.navbar-menu::-webkit-scrollbar-thumb {
background-color: transparent;
}
.profile-dropdown {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
position: absolute;
cursor: pointer;
top: 106px;
}
.submenu-dropdown {
display: none;
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0, 0, 0, 0.15);
cursor: pointer;
position: absolute;
top: 20px;
left:0;
}
.navbar-menu-each:hover > .submenu-dropdown,
.submenu-dropdown:hover {
display: block;
}
.submenu-dropdown-each {
display: block;
line-height: 48px;
font-size: 13px;
color: #333;
width: auto;
padding: 0 32px 0 24px;
}
.submenu-dropdown-each:hover {
background: #f8f8f8;
}
.submenu-selected {
font-weight: 700;
color: #00c983;
}
.profile-dropdown {
padding-top: 8px;
width: 208px;
top: 53px;
right: 20px;
display: none;
}
.profile-dropdown-each {
display: block;
font-size: 13px;
line-height: 36px;
padding-left: 16px;
}
.profile-dropdown-each-section {
color: #aaa;
text-transform: uppercase;
font-weight: 700;
}
.profile-dropdown-check {
float: right;
margin-right: 16px;
}
.profile-dropdown-each-border-top {
border-top: solid 1px #eee;
}
.switch-language-group {
float: right;
margin-right: 16px;
}
.button-language {
height: 24px;
width: 32px;
border: solid 1px #c4c4c4;
display: inline-block;
line-height: 24px;
text-align: center;
}
.button-language-left {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform: translateX(4px);
}
.button-language-right {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.button-language-active {
background-color: #00c983;
color: #fff;
border: solid 1px #00c983;
}
.profile-dropdown-check i {
display: none;
}
.profile-dropdown-check i.role-active {
display: inline-block;
color: #00c983;
}
.callout {
width: 260px;
float: left;
background-color: #fff;
position: relative;
color: #333;
font-size: 13px;
margin: 25px;
min-height: 50px;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
position: absolute;
right: 102px;
top: 32px;
z-index: 999;
display: none;
}
.callout::before {
content: "";
width: 0px;
height: 0px;
border: 0.8em solid transparent;
position: absolute;
}
.callout.bottom::before {
left: 45%;
top: -20px;
border-bottom: 10px solid #f8f8f8;
}
.callout-title {
background-color: #f8f8f8;
line-height: 32px;
border-bottom: solid 1px #eee;
padding-left: 16px;
}
.callout-content {
display: block;
padding: 16px;
}
.callout-row {
display: block;
width: 100%;
}
.navbar-module-wrapper {
display: inline-block;
width: 49%;
vertical-align: middle;
text-align: center;
height: 100px;
padding-top: 8px;
padding-bottom: 8px;
cursor: pointer;
border-radius: 3px;
}
.navbar-module-wrapper:hover {
background: #f8f8f8;
}
.navbar-module-wrapper-left {
}
.navbar-module-icon {
width: 48px;
padding: 16px 16px 8px 16px;
}
.caption-basic {
transform: translateY(8px);
}
.icon-tm {
width: 44px;
transform: translateY(-4px);
}
.caption-tm {
transform: translateY(-8px);
}
.icon-recr {
width: 46px;
}
.caption-recr {
transform: translateY(4px);
}
.icon-talent {
width: 38px;
transform: translateY(-2px);
}
.caption-talent {
transform: translateY(-6px);
}
.icon-bm {
width: 50px;
}
.caption-bm {
transform: translateY(-4px);
}
.navbar-module-name {
line-height: 16px;
vertical-align: middle;
height: 60px;
}
.main-sidebar {
background-color: #fff;
box-shadow: 0px 3px 6px 0 rgba(0,0,0,0.15);
width: 240px;
font-size: 13px;
color: #333;
position: absolute;
top: 51px;
left: -260px;
-webkit-transition: left 0.5s;
transition: left 0.5s;
height: 717px;
z-index: 10;
}
.main-sidebar-list-wrapper {
height: 669px;
width: 240px;
overflow: auto;
}
.main-sidebar-view {
left: 0;
-webkit-transition: left 0.5s;
transition: left 0.5s;
}
.sidebar-section {
width: 240px;
}
.sidebar-section li {
display: block;
line-height: 48px;
padding-left: 16px;
height: 48px;
}
.sidebar-section-title {
border-bottom: solid 1px #eee;
font-size: 16px;
}
.sidebar-icon {
position: relative;
display: inline-block;
width: 28px;
height: 48px;
}
.sidebar-icon img {
width: 18px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.sidebar-menu {
display: inline-block;
vertical-align: top;
}
.main-sidebar-list-wrapper::-webkit-scrollbar {
height: 0;
}
.main-sidebar-list-wrapper::-webkit-scrollbar-thumb {
background-color: transparent;
}
.main-sidebar-footer {
height: 48px;
line-height: 48px;
text-align: center;
border-top: solid 1px #eee;
}
@media (max-width: 767px) and (min-width: 576px) {
.navbar-top {
padding: 0 24px;
}
.navbar-menu-each:first-child {
padding-left: 24px;
}
.navbar-page-name {
padding-left: 24px;
}
.callout {
right: 94px;
}
}
@media (max-width: 575px) {
.module-name {
display: none;
}
.profile-name {
display: none;
}
.modules-icon {
display: none;
}
.navbar-top {
padding: 0 16px;
}
.navbar-menu-each:first-child {
padding-left: 16px;
}
.navbar-page-name {
padding-left: 16px;
}
.profile-dropdown-icon {
margin-left: 0;
}
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<div class="container">
<div class="navbar">
<div class="main-sidebar">
<div class="main-sidebar-list-wrapper">
<ul class="sidebar-section">
<li class="sidebar-section-title">Organization</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/LZ44Z0dPvtn2OCGT02lwNZuaUK76Zw69uaYSF4sTe63PtTpKS4IiUM7LjsV5VvlH1hsB6bZM4rA8g9fVsYgUzg/192"></span>
<span class="sidebar-menu">Company</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/8pNCxwrs9k-2fnR6iCzgQ-FEhutp_EcFTTfb9jD207NZSwBU98yuTSPZAKwsh7muBJKKG-MBcsgoqbEpXnZLnQ/213"></span>
<span class="sidebar-menu">Employee</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/mE5M0CywlR63kvqGKenpBEdDFYpOnpHB02javJrGr8r0gJGl_-vuUnKJJpWe6pZChsjIq1yXUgofhicw7MvFCw/177"></span>
<span class="sidebar-menu">Termination</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Compensation & Benefits</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/YlkzS0yo52ARysEUFWYs53WfQH7D1kGaAoxmnqhpSOX7nDKTgYxPsF8CuP-EQlJBNM_ye68YqYc2J0BcSLPJwg/159"></span>
<span class="sidebar-menu">Setup</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/vYgvWe324-eiGFdWDNoBi7WrWHUAFhEbZCoLWve5NE2rBrFrGmK7ZLjW3W0ggCHce1BCyY6FFTzxRm-Fg9VmBA/168"></span>
<span class="sidebar-menu">BPJS Ketenagakerjaan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/bVKXdl3sBeP8-w1wTrEapdUOlcJFSPi4_koRbRVtzL2NR8N-BPZdJUdpPWjSXC13Um6GLbt5DO1DV2t_j7hQDw/168"></span>
<span class="sidebar-menu">BPJS Kesehatan</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/TaVNZzoRbkdvziFtWEyv4sEVQMnVVteQt2CB9aCU4xyOdTaCTDAqL9mqUA-3nGmdJZ7qzLZbxXr2xfXjlVDpDg/173"></span>
<span class="sidebar-menu">Payroll</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/NAZCBsbI_bURxMPsr3N05H2_d8KSiz_RtfaMqHp8Tg8tKFEb4RN-5aHgFQiz0y05Ik4BAD8RMRb5LC-Ufg35zA/175"></span>
<span class="sidebar-menu">PPh 21</span>
</li>
</ul>
<ul class="sidebar-section">
<li class="sidebar-section-title">Admin Panel</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/FNTOwLJTLz1ndzUxgINBH_tCYJgn7rp-HvtVlpTSN1RQ1yuy1q7UskqQikaey0uHl2Fu7C-rXOgaw_VsGH82Lg/136"></span>
<span class="sidebar-menu">User Management</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/DLaWkbWQ4jxYfEVNpCKBxOyS8G1mzuN24jzbf62tvMsYRvMD0zob2s2K1mBCj62YTYM_MaQmJlt6KmS0WY2uwA/159"></span>
<span class="sidebar-menu">Master Data</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/h2z5yDkjFcZ5OwhHWcI6VrhUL9Yj-u43QPEjlo7XyHE2pR-ghxrJdXw8mfB5C89AzEd403gqfCrd2JAUMbJ1xQ/199"></span>
<span class="sidebar-menu">Log</span>
</li>
<li class="sidebar-section-each">
<span class="sidebar-icon"><img src="https://cdn.frontify.com/api/screen/thumbnail/cn4XSK1tZu9KoSq5Q7iQXAMWcqjw5JolDHCvP52UD2wvu2brkBoit1F7SDUJmFVChGbo1LthZixKzx5ee3jJsQ/156"></span>
<span class="sidebar-menu">Data Migration</span>
</li>
</ul>
</div>
<div class="main-sidebar-footer">
© CATAPA 2017
</div>
</div>
<div class="navbar-logo-wrapper">
<img class="navbar-tree" src="https://cdn.frontify.com/api/screen/thumbnail/7UV_lfX5OBfHxFn5lc3ygK8UTU3z5pivwY9QDSDIOiFemj-DdmDzmwiPvbibaG63IMXz-MmGOs4aH-UqgoT9gw/350">
</div>
<div class="navbar-top">
<div class="navbar-top-left">
<div class="burger-btn-wrapper">
<i class="fas fa-bars"></i>
</div>
<div class="module-name">Employee</div>
</div>
<div class="navbar-top-right">
<div class="modules-icon"><i class="fas fa-th"></i></div>
<div class="navbar-profile">
<div class="profpic-wrapper">
<div class="navbar-profpic">
<div class="profile-initial">DJ</div>
</div>
</div>
<div class="profile-name">Dennis Jonathan</div>
<div class="profile-dropdown-icon"><i class="fas fa-chevron-down"></i></div>
</div>
</div>
</div>
<div class="navbar-menu">
<ul class="navbar-menu-list">
<li class="navbar-menu-each">
<a href="#">Employee Directory</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>New Employee Registration</li>
<li class='submenu-dropdown-each submenu-selected'>Employee List</li>
<li class='submenu-dropdown-each'>Employee Rehire</li>
<li class='submenu-dropdown-each'>Employee Without Bank Account</li>
<li class='submenu-dropdown-each'>Employee Without PPh 21</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Memo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Memo Template</li>
<li class='submenu-dropdown-each'>Print Memo</li>
</ul>
</li>
<li class="navbar-menu-each"><a href="#">Bulk Update</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Download & Upload</li>
<li class='submenu-dropdown-each'>Send Email</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Approvals and Undo</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Approvals</li>
<li class='submenu-dropdown-each'>Employment Status Undo</li>
</ul>
</li>
<li class="navbar-menu-each">
<a href="#">Report</a>
<ul class="submenu-dropdown">
<li class='submenu-dropdown-each'>Employee Data Report</li>
<li class='submenu-dropdown-each'>Headcount Report</li>
<li class='submenu-dropdown-each'>Employee Recapitulation Report</li>
</ul>
</li>
</ul>
</div>
<div class="navbar-page-name">
Employee List
</div>
</div>
<div class="cover-top"></div>
<div class="cover-left"></div>
<div class="cover-right"></div>
<div class="cover-bottom"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>