Is it possible to tell an absolutely positioned list item to push the next list item down? https://jsfiddle.net/230cfs4g/ In this example, the list items under Sub-Menu overlap the links under it.
My goal is for it to push the other links UNDER it down, similar to how the mobile version (included) functions, whilst still maintaining the hover over the content aspect that you expect from a desktop menu..
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet">
<nav>
<div class="nav-menu">
<div class="menu-navmenu-container">
<ul id="menu-navmenu" class="menu">
<li id="menu-item-3499" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3499"><a href="=">Home</a></li>
<li id="menu-item-3855" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-3855 menu-item-with-children">
<a>Services</a>
<ul class="sub-menu">
<li id="menu-item-4498" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-4498 menu-item-with-children">
<a href="">SubMenu</a>
<ul class="sub-menu">
<li id="menu-item-3664" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3664"><a href="=">Link</a></li>
<li id="menu-item-4339" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-4339 menu-item-with-children">
<a href="=">Link</a>
<ul class="sub-menu">
<li id="menu-item-3497" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3497"><a href="=">Link</a></li>
</ul>
</li>
</ul>
</li>
<li id="menu-item-3529" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3529"><a href="=">Link</a></li>
<li id="menu-item-4219" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-4219"><a href="=">Link</a></li>
<li id="menu-item-3585" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3585"><a href="=">Link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
body {
background-color: #191919;}
a {
font-family: 'Raleway', sans-serif;
}
p {color: #fff;}
.menu-item-with-children > a::after {
font-family: "Font Awesome 5 Free";
font-size: 15px;
line-height: 16px;
font-weight: 900;
content: "\f078";
padding-left: 5px;
}
.sub-menu {
display: none;
}
.active {display: block;}
.menu {
background-color: white;
white-space:nowrap;
margin: auto;
width: 100%;
}
.menu-item {
}
.menu-item a {
color: #666;
padding: 5px;
font-size: 24px;
font-weight: 500;
text-decoration: none;
}
.menu li {
list-style-type: none;
}
.menu-item a:hover {
color: #007bff;
background-color: #cfe6ff;
}
.sub-menu {
padding-left: 20px;
}
.menu li a {
display: block;
}
.sub-menu li a {
font-size: 20px;
padding: 5px;
}
.menu-item-with-children .active {
font-weight: bold;
}
.menu {background-color: #fff;}
.sub-menu.active {
background-color: #fff;
}
.menu-item-with-children .active li {
border-left: 2px solid #c9c9c9;
padding-left: 20px;
}
/*Desktop */
@media all and (min-width: 960px) {
.menu {
display: flex;
margin-top: 6px;
}
.menu-item {
width: auto;
}
.menu-item a {
font-size: 24px ;
padding: 5px 25px 0 25px;
}
.sub-menu {
position: fixed;
padding: 0;
min-width: 200px;
}
/*Trying to figure out how to get the list items to push the content down*/```